Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions webhook/configmaps/configmaps.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ func (ac *reconciler) reconcileValidatingWebhook(ctx context.Context, caCert []b
return fmt.Errorf("failed to fetch namespace: %w", err)
}
nsRef := *metav1.NewControllerRef(ns, corev1.SchemeGroupVersion.WithKind("Namespace"))
nsRef.Controller = ptr.Bool(false)
webhook.OwnerReferences = []metav1.OwnerReference{nsRef}
}

Expand Down
1 change: 1 addition & 0 deletions webhook/configmaps/table_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ func TestReconcile(t *testing.T) {
},
}
nsRef := *metav1.NewControllerRef(ns, corev1.SchemeGroupVersion.WithKind("Namespace"))
nsRef.Controller = ptr.Bool(false)
expectedOwnerReferences := []metav1.OwnerReference{nsRef}

ruleScope := admissionregistrationv1.NamespacedScope
Expand Down
1 change: 1 addition & 0 deletions webhook/resourcesemantics/defaulting/defaulting.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ func (ac *reconciler) reconcileMutatingWebhook(ctx context.Context, caCert []byt
return fmt.Errorf("failed to fetch namespace: %w", err)
}
nsRef := *metav1.NewControllerRef(ns, corev1.SchemeGroupVersion.WithKind("Namespace"))
nsRef.Controller = ptr.Bool(false)
current.OwnerReferences = []metav1.OwnerReference{nsRef}
}

Expand Down
1 change: 1 addition & 0 deletions webhook/resourcesemantics/defaulting/table_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ func TestReconcile(t *testing.T) {
},
}
nsRef := *metav1.NewControllerRef(ns, corev1.SchemeGroupVersion.WithKind("Namespace"))
nsRef.Controller = ptr.Bool(false)
expectedOwnerReferences := []metav1.OwnerReference{nsRef}

// This is the namespace selector setup
Expand Down
1 change: 1 addition & 0 deletions webhook/resourcesemantics/validation/reconcile_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ func (ac *reconciler) reconcileValidatingWebhook(ctx context.Context, caCert []b
return fmt.Errorf("failed to fetch namespace: %w", err)
}
nsRef := *metav1.NewControllerRef(ns, corev1.SchemeGroupVersion.WithKind("Namespace"))
nsRef.Controller = ptr.Bool(false)
current.OwnerReferences = []metav1.OwnerReference{nsRef}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ func TestReconcile(t *testing.T) {
},
}
nsRef := *metav1.NewControllerRef(ns, corev1.SchemeGroupVersion.WithKind("Namespace"))
nsRef.Controller = ptr.Bool(false)
expectedOwnerReferences := []metav1.OwnerReference{nsRef}

// This is the namespace selector setup
Expand Down
Loading