@@ -69,7 +69,7 @@ func (r *KubeconfigReconciler) Reconcile(ctx context.Context, req ctrl.Request)
69
69
logger .V (4 ).Info ("Reconciling" )
70
70
71
71
var kc operatorv1alpha1.Kubeconfig
72
- if err := r .Client . Get (ctx , req .NamespacedName , & kc ); err != nil {
72
+ if err := r .Get (ctx , req .NamespacedName , & kc ); err != nil {
73
73
return ctrl.Result {}, err
74
74
}
75
75
@@ -80,7 +80,7 @@ func (r *KubeconfigReconciler) Reconcile(ctx context.Context, req ctrl.Request)
80
80
switch {
81
81
case kc .Spec .Target .RootShardRef != nil :
82
82
var rootShard operatorv1alpha1.RootShard
83
- if err := r .Client . Get (ctx , types.NamespacedName {Name : kc .Spec .Target .RootShardRef .Name , Namespace : req .Namespace }, & rootShard ); err != nil {
83
+ if err := r .Get (ctx , types.NamespacedName {Name : kc .Spec .Target .RootShardRef .Name , Namespace : req .Namespace }, & rootShard ); err != nil {
84
84
return ctrl.Result {}, fmt .Errorf ("failed to get RootShard: %w" , err )
85
85
}
86
86
@@ -91,7 +91,7 @@ func (r *KubeconfigReconciler) Reconcile(ctx context.Context, req ctrl.Request)
91
91
92
92
case kc .Spec .Target .ShardRef != nil :
93
93
var shard operatorv1alpha1.Shard
94
- if err := r .Client . Get (ctx , types.NamespacedName {Name : kc .Spec .Target .ShardRef .Name , Namespace : req .Namespace }, & shard ); err != nil {
94
+ if err := r .Get (ctx , types.NamespacedName {Name : kc .Spec .Target .ShardRef .Name , Namespace : req .Namespace }, & shard ); err != nil {
95
95
return ctrl.Result {}, fmt .Errorf ("failed to get Shard: %w" , err )
96
96
}
97
97
@@ -100,7 +100,7 @@ func (r *KubeconfigReconciler) Reconcile(ctx context.Context, req ctrl.Request)
100
100
return ctrl.Result {}, errors .New ("the Shard does not reference a (valid) RootShard" )
101
101
}
102
102
var rootShard operatorv1alpha1.RootShard
103
- if err := r .Client . Get (ctx , types.NamespacedName {Name : ref .Name , Namespace : req .Namespace }, & rootShard ); err != nil {
103
+ if err := r .Get (ctx , types.NamespacedName {Name : ref .Name , Namespace : req .Namespace }, & rootShard ); err != nil {
104
104
return ctrl.Result {}, fmt .Errorf ("failed to get RootShard: %w" , err )
105
105
}
106
106
@@ -112,7 +112,7 @@ func (r *KubeconfigReconciler) Reconcile(ctx context.Context, req ctrl.Request)
112
112
113
113
case kc .Spec .Target .FrontProxyRef != nil :
114
114
var frontProxy operatorv1alpha1.FrontProxy
115
- if err := r .Client . Get (ctx , types.NamespacedName {Name : kc .Spec .Target .FrontProxyRef .Name , Namespace : req .Namespace }, & frontProxy ); err != nil {
115
+ if err := r .Get (ctx , types.NamespacedName {Name : kc .Spec .Target .FrontProxyRef .Name , Namespace : req .Namespace }, & frontProxy ); err != nil {
116
116
return ctrl.Result {}, fmt .Errorf ("referenced FrontProxy '%s' does not exist" , kc .Spec .Target .FrontProxyRef .Name )
117
117
}
118
118
@@ -121,7 +121,7 @@ func (r *KubeconfigReconciler) Reconcile(ctx context.Context, req ctrl.Request)
121
121
return ctrl.Result {}, errors .New ("the FrontProxy does not reference a (valid) RootShard" )
122
122
}
123
123
var rootShard operatorv1alpha1.RootShard
124
- if err := r .Client . Get (ctx , types.NamespacedName {Name : frontProxy .Spec .RootShard .Reference .Name , Namespace : req .Namespace }, & rootShard ); err != nil {
124
+ if err := r .Get (ctx , types.NamespacedName {Name : frontProxy .Spec .RootShard .Reference .Name , Namespace : req .Namespace }, & rootShard ); err != nil {
125
125
return ctrl.Result {}, fmt .Errorf ("failed to get RootShard: %w" , err )
126
126
}
127
127
@@ -174,7 +174,7 @@ func (r *KubeconfigReconciler) getCertificateSecret(ctx context.Context, name, n
174
174
logger := log .FromContext (ctx ).WithValues ("certificate" , name )
175
175
176
176
certificate := & certmanagerv1.Certificate {}
177
- if err := r .Client . Get (ctx , types.NamespacedName {Name : name , Namespace : namespace }, certificate ); err != nil {
177
+ if err := r .Get (ctx , types.NamespacedName {Name : name , Namespace : namespace }, certificate ); err != nil {
178
178
// Because of how the reconciling framework works, this should never happen.
179
179
logger .V (6 ).Info ("Certificate does not exist yet, trying later ..." )
180
180
return nil , nil
@@ -194,7 +194,7 @@ func (r *KubeconfigReconciler) getCertificateSecret(ctx context.Context, name, n
194
194
}
195
195
196
196
secret := & corev1.Secret {}
197
- if err := r .Client . Get (ctx , types.NamespacedName {Name : certificate .Spec .SecretName , Namespace : certificate .Namespace }, secret ); err != nil {
197
+ if err := r .Get (ctx , types.NamespacedName {Name : certificate .Spec .SecretName , Namespace : certificate .Namespace }, secret ); err != nil {
198
198
return nil , err
199
199
}
200
200
0 commit comments