Skip to content
Merged
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
2 changes: 1 addition & 1 deletion pkg/controllers/cloud_config_sync_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func (r *CloudConfigReconciler) isCloudConfigSyncNeeded(platformStatus *configv1
return false, fmt.Errorf("platformStatus is required")
}
switch platformStatus.Type {
case configv1.AWSPlatformType: // aws ccm does not use cloud-config at the moment
case configv1.AWSPlatformType, configv1.BareMetalPlatformType: // aws ccm does not use cloud-config at the moment
return false, nil
default:
return true, nil
Expand Down
12 changes: 12 additions & 0 deletions pkg/controllers/cloud_config_sync_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,18 @@ var _ = Describe("Cloud config sync reconciler", func() {
Expect(len(allCMs.Items)).To(BeZero())
})

It("should skip config sync for BareMetal platform", func() {
infraResource := makeInfrastructureResource(configv1.BareMetalPlatformType)
Expect(cl.Create(ctx, infraResource)).To(Succeed())
infraResource.Status = makeInfraStatus(infraResource.Spec.PlatformSpec.Type)
Expect(cl.Status().Update(ctx, infraResource.DeepCopy())).To(Succeed())
_, err := reconciler.Reconcile(context.TODO(), ctrl.Request{})
Expect(err).To(BeNil())
allCMs := &corev1.ConfigMapList{}
Expect(cl.List(ctx, allCMs, &client.ListOptions{Namespace: targetNamespaceName})).To(Succeed())
Expect(len(allCMs.Items)).To(BeZero())
})

It("should perform config sync for Azure platform", func() {
infraResource := makeInfrastructureResource(configv1.AzurePlatformType)
Expect(cl.Create(ctx, infraResource)).To(Succeed())
Expand Down