Skip to content

Commit c132269

Browse files
committed
Address comments
Signed-off-by: Dr. Stefan Schimanski <[email protected]>
1 parent b3408c3 commit c132269

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/admission/crdnooverlappinggvr/crdnooverlappinggvr_admission.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import (
3434
"k8s.io/client-go/util/retry"
3535
"k8s.io/utils/ptr"
3636

37+
"github.com/kcp-dev/kcp/pkg/admission/initializers"
3738
"github.com/kcp-dev/kcp/pkg/reconciler/apis/apibinding"
3839
corev1alpha1 "github.com/kcp-dev/kcp/sdk/apis/core/v1alpha1"
3940
kcpclientset "github.com/kcp-dev/kcp/sdk/client/clientset/versioned/cluster"
@@ -67,12 +68,16 @@ type crdNoOverlappingGVRAdmission struct {
6768
// Ensure that the required admission interfaces are implemented.
6869
var _ = admission.ValidationInterface(&crdNoOverlappingGVRAdmission{})
6970
var _ = admission.InitializationValidator(&crdNoOverlappingGVRAdmission{})
71+
var _ = initializers.WantsKcpInformers(&crdNoOverlappingGVRAdmission{})
72+
var _ = initializers.WantsKcpClusterClient(&crdNoOverlappingGVRAdmission{})
7073

74+
// SetKcpInformers sets the informer for kcp resources. It's part of WantsKcpInformers.
7175
func (p *crdNoOverlappingGVRAdmission) SetKcpInformers(local, global kcpinformers.SharedInformerFactory) {
7276
p.SetReadyFunc(local.Apis().V1alpha1().APIBindings().Informer().HasSynced)
7377
p.logicalclusterLister = local.Core().V1alpha1().LogicalClusters().Lister()
7478
}
7579

80+
// SetKcpClusterClient sets the client for kcp resources. It's part of WantsKcpClusterClient.
7681
func (p *crdNoOverlappingGVRAdmission) SetKcpClusterClient(c kcpclientset.ClusterInterface) {
7782
p.updateLogicalCluster = func(ctx context.Context, logicalCluster *corev1alpha1.LogicalCluster, opts metav1.UpdateOptions) (*corev1alpha1.LogicalCluster, error) {
7883
return c.CoreV1alpha1().LogicalClusters().Cluster(logicalcluster.From(logicalCluster).Path()).Update(ctx, logicalCluster, opts)

0 commit comments

Comments
 (0)