INNER CODE UNIT · Go
revertConfig
kumahq/kuma · app/cni/pkg/install/main.go:73
func revertConfig(configPath string, chained bool) error {
if !files.FileExists(configPath) {
log.Info("no need to revert config - file does not exist", "configPath", configPath)
return nil
}
if chained {
contents, err := os.ReadFile(configPath)
if err != nil {
return errors.Wrap(err, "could not read cni conf file")
}
newContents, err := revertConfigContents(contents)
if err != nil {
return errors.Wrap(err, "could not revert config contents")
}
if err := atomic.WriteFile(configPath, bytes.NewReader(newContents)); err != nil {