@@ -18,6 +18,7 @@ import (
18
18
"context"
19
19
"fmt"
20
20
21
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
21
22
"k8s.io/apimachinery/pkg/runtime"
22
23
"sigs.k8s.io/controller-runtime/pkg/client"
23
24
"sigs.k8s.io/controller-runtime/pkg/controller"
@@ -26,7 +27,9 @@ import (
26
27
"sigs.k8s.io/controller-runtime/pkg/manager"
27
28
"sigs.k8s.io/controller-runtime/pkg/reconcile"
28
29
30
+ v3 "github.com/tigera/api/pkg/apis/projectcalico/v3"
29
31
operatorv1 "github.com/tigera/operator/api/v1"
32
+
30
33
"github.com/tigera/operator/pkg/common"
31
34
"github.com/tigera/operator/pkg/controller/certificatemanager"
32
35
"github.com/tigera/operator/pkg/controller/options"
@@ -197,6 +200,14 @@ func (r *Reconciler) Reconcile(ctx context.Context, request reconcile.Request) (
197
200
)
198
201
if err != nil {
199
202
r .status .SetDegraded (operatorv1 .ResourceCreateError , "Unable to create the trusted bundle" , err , reqLogger )
203
+ return reconcile.Result {}, err
204
+ }
205
+
206
+ clusterInfo := & v3.ClusterInformation {ObjectMeta : metav1.ObjectMeta {Name : "default" }}
207
+ err = r .cli .Get (ctx , client .ObjectKeyFromObject (clusterInfo ), clusterInfo )
208
+ if err != nil {
209
+ r .status .SetDegraded (operatorv1 .ResourceReadError , "Failed to get ClusterInformation: " , err , reqLogger )
210
+ return reconcile.Result {}, err
200
211
}
201
212
202
213
ch := utils .NewComponentHandler (log , r .cli , r .scheme , whiskerCR )
@@ -206,6 +217,9 @@ func (r *Reconciler) Reconcile(ctx context.Context, request reconcile.Request) (
206
217
Installation : installation ,
207
218
TrustedCertBundle : trustedBundle ,
208
219
WhiskerBackendKeyPair : backendKeyPair ,
220
+ WhiskerID : clusterInfo .Spec .ClusterGUID ,
221
+ ClusterType : clusterInfo .Spec .ClusterType ,
222
+ CalicoVersion : clusterInfo .Spec .CalicoVersion ,
209
223
}
210
224
211
225
certComponent := rcertificatemanagement .CertificateManagement (& rcertificatemanagement.Config {
0 commit comments