Skip to content

Commit

Permalink
[deploy/env] update protected annotation correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
maorfr committed Dec 23, 2018
1 parent ff8c90a commit fba5f48
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/orca/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,9 @@ func updateProtectedCharts(name, kubeContext string, protectedChartsToAdd []stri
protectedCharts = append(protectedCharts, pcta)
}

annotationValue := strings.Join(protectedCharts, ",")
annotations := map[string]string{protectedAnnotation: annotationValue}

protectedChartsWithoutAdds := []string{}
for _, pr := range protectedCharts {
if utils.Contains(protectedChartsToAdd, pr) {
Expand All @@ -680,9 +683,6 @@ func updateProtectedCharts(name, kubeContext string, protectedChartsToAdd []stri
protectedChartsWithoutAdds = append(protectedChartsWithoutAdds, pr)
}

annotationValue := strings.Join(protectedChartsWithoutAdds, ",")
annotations := map[string]string{protectedAnnotation: annotationValue}
err = utils.UpdateNamespace(name, kubeContext, annotations, map[string]string{}, print)

return protectedChartsWithoutAdds, err
}

0 comments on commit fba5f48

Please sign in to comment.