Skip to content

Commit

Permalink
Merge pull request #90 from thedadams/allow-subctx-change-no-owner
Browse files Browse the repository at this point in the history
Allow a subcontext change if no owner was set previously
  • Loading branch information
thedadams authored Jul 7, 2023
2 parents 3f68234 + ad626dd commit 5d519d2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/apply/desiredset_process.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,9 @@ func isAllowOwnerTransition(existingObj, newObj kclient.Object) bool {
existingAnno := existingObj.GetAnnotations()
newAnno := newObj.GetAnnotations()
return newAnno[LabelSubContext] != "" &&
existingAnno[LabelGVK] == newAnno[LabelGVK] &&
existingAnno[LabelNamespace] == newAnno[LabelNamespace] &&
existingAnno[LabelName] == newAnno[LabelName] &&
(existingAnno[LabelGVK] == "" || existingAnno[LabelGVK] == newAnno[LabelGVK]) &&
(existingAnno[LabelNamespace] == "" || existingAnno[LabelNamespace] == newAnno[LabelNamespace]) &&
(existingAnno[LabelName] == "" || existingAnno[LabelName] == newAnno[LabelName]) &&
validOwnerChange[fmt.Sprintf("%s => %s", existingAnno[LabelSubContext], newAnno[LabelSubContext])]

}
Expand Down

0 comments on commit 5d519d2

Please sign in to comment.