Skip to content

Commit

Permalink
Stop relying on GVK being set on SCP object
Browse files Browse the repository at this point in the history
  • Loading branch information
thbkrkr committed Jan 29, 2024
1 parent 5a1c4a8 commit dee2ebb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pkg/controller/elasticsearch/filesettings/secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func SetSoftOwner(settingsSecret *corev1.Secret, policy policyv1alpha1.StackConf
}
settingsSecret.Labels[reconciler.SoftOwnerNamespaceLabel] = policy.GetNamespace()
settingsSecret.Labels[reconciler.SoftOwnerNameLabel] = policy.GetName()
settingsSecret.Labels[reconciler.SoftOwnerKindLabel] = policy.GetObjectKind().GroupVersionKind().Kind
settingsSecret.Labels[reconciler.SoftOwnerKindLabel] = policyv1alpha1.Kind
}

// setSecureSettings stores the SecureSettings Secret sources referenced in the given StackConfigPolicy in the annotation of the Settings Secret.
Expand Down Expand Up @@ -163,7 +163,7 @@ func CanBeOwnedBy(settingsSecret corev1.Secret, policy policyv1alpha1.StackConfi
return reconciler.SoftOwnerRef{}, true
}
// or the owner is already the given policy
canBeOwned := currentOwner.Kind == policy.Kind && currentOwner.Namespace == policy.Namespace && currentOwner.Name == policy.Name
canBeOwned := currentOwner.Kind == policyv1alpha1.Kind && currentOwner.Namespace == policy.Namespace && currentOwner.Name == policy.Name
return currentOwner, canBeOwned
}

Expand Down
3 changes: 0 additions & 3 deletions pkg/controller/stackconfigpolicy/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,6 @@ func TestReconcileStackConfigPolicy_Reconcile(t *testing.T) {
Name: "test-policy",
}
policyFixture := policyv1alpha1.StackConfigPolicy{
TypeMeta: metav1.TypeMeta{
Kind: "StackConfigPolicy",
},
ObjectMeta: metav1.ObjectMeta{
Namespace: "ns",
Name: "test-policy",
Expand Down

0 comments on commit dee2ebb

Please sign in to comment.