Skip to content

Commit

Permalink
Add IfNotPresent and Ignore SSA policies
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Prodan <[email protected]>
  • Loading branch information
stefanprodan committed Aug 9, 2023
1 parent 6b85c71 commit 6d32b08
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion api/v1/kustomization_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ const (
MaxConditionMessageLength = 20000
EnabledValue = "enabled"
DisabledValue = "disabled"
MergeValue = "merge"
MergeValue = "Merge"
IfNotPresentValue = "IfNotPresent"
IgnoreValue = "Ignore"
)

// KustomizationSpec defines the configuration to calculate the desired state
Expand Down
4 changes: 4 additions & 0 deletions internal/controller/kustomization_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,10 @@ func (r *KustomizationReconciler) apply(ctx context.Context,
applyOpts.Force = obj.Spec.Force
applyOpts.ExclusionSelector = map[string]string{
fmt.Sprintf("%s/reconcile", kustomizev1.GroupVersion.Group): kustomizev1.DisabledValue,
fmt.Sprintf("%s/ssa", kustomizev1.GroupVersion.Group): kustomizev1.IgnoreValue,
}
applyOpts.IfNotPresentSelector = map[string]string{
fmt.Sprintf("%s/ssa", kustomizev1.GroupVersion.Group): kustomizev1.IfNotPresentValue,
}
applyOpts.ForceSelector = map[string]string{
fmt.Sprintf("%s/force", kustomizev1.GroupVersion.Group): kustomizev1.EnabledValue,
Expand Down

0 comments on commit 6d32b08

Please sign in to comment.