Minor fixes

This commit is contained in:
Nikolai Rodionov 2024-01-18 11:44:44 +01:00
parent 8e7a8998d3
commit cb8445666a
Signed by: allanger
GPG Key ID: 0AA46A90E25592AD
2 changed files with 13 additions and 13 deletions

View File

@ -125,7 +125,7 @@ func Sync(definedWorkdirPath, sshKeyPath string, conf *config.Config, dry bool,
// if err := hh.RenderChart(workdirPath, release.ToHelmReleaseData()); err != nil {
// return err
// }
//
// }
if err := release.ValuesHandler(configPath); err != nil {

View File

@ -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)