diff --git a/internal/controller/controller.go b/internal/controller/controller.go index 20fb840..1ccff76 100644 --- a/internal/controller/controller.go +++ b/internal/controller/controller.go @@ -117,16 +117,16 @@ func Sync(definedWorkdirPath, sshKeyPath string, conf *config.Config, dry bool, for _, release := range conf.Releases { - // if len(diffArg) > 0 { - // _, err := hh.PullChart(workdirPath, release.ToHelmReleaseData()) - // if err != nil { - // return err - // } - // if err := hh.RenderChart(workdirPath, release.ToHelmReleaseData()); err != nil { - // return err - // } - - // } + // if len(diffArg) > 0 { + // _, err := hh.PullChart(workdirPath, release.ToHelmReleaseData()) + // if err != nil { + // return err + // } + // if err := hh.RenderChart(workdirPath, release.ToHelmReleaseData()); err != nil { + // return err + // } + // + // } if err := release.ValuesHandler(configPath); err != nil { return err diff --git a/internal/providers/flux.go b/internal/providers/flux.go index 5c4d1b4..671974c 100644 --- a/internal/providers/flux.go +++ b/internal/providers/flux.go @@ -344,6 +344,9 @@ func SyncValues(currentRelease, wishedRelease *release.Release, secDirPath strin func SyncSecrets(currentRelease, wishedRelease *release.Release, workdirPath, sopsBin string) error { secretsDirPath := fmt.Sprintf("%s/src/secrets", workdirPath) + if err := os.MkdirAll(secretsDirPath, os.ModePerm); err != nil { + return err + } if currentRelease != nil { for _, secrets := range currentRelease.DestSecrets { secretsFilePath := fmt.Sprintf("%s/%s", secretsDirPath, secrets.DestPath) @@ -358,9 +361,6 @@ func SyncSecrets(currentRelease, wishedRelease *release.Release, workdirPath, so // Prepare a dir for secrets secretsFilePath := fmt.Sprintf("%s/%s", secretsDirPath, secrets.DestPath) logrus.Infof("trying to create secrets file: %s", secretsFilePath) - if err := os.MkdirAll(secretsDirPath, os.ModePerm); err != nil { - return err - } var secretsFile *os.File if _, err := os.Stat(secretsFilePath); err == nil { secretsFile, err = os.Open(secretsFilePath)