@@ -26,38 +26,43 @@ import (
2626type cloudConfigTransformer func (source string , infra * configv1.Infrastructure , network * configv1.Network ) (string , error )
2727
2828// GetCloudConfigTransformer returns the function that should be used to transform
29- // the cloud configuration config map
30- func GetCloudConfigTransformer (platformStatus * configv1.PlatformStatus ) (cloudConfigTransformer , error ) {
29+ // the cloud configuration config map, and a boolean to indicate if the config should
30+ // be synced from the CCO namespace before applying the transformation.
31+ // TODO: the boolean return value to indicate if the config should be synced can be
32+ // removed once we migrate the AWS and Azure logic from the CCO to this operator.
33+ // See the FIXME comments below, and the TODO comment in the Reconcile function
34+ // inside cloud_config_sync_controller.go.
35+ func GetCloudConfigTransformer (platformStatus * configv1.PlatformStatus ) (cloudConfigTransformer , bool , error ) {
3136 switch platformStatus .Type {
3237 case configv1 .AlibabaCloudPlatformType :
33- return common .NoOpTransformer , nil
38+ return common .NoOpTransformer , false , nil
3439 case configv1 .AWSPlatformType :
3540 // We intentionally return nil rather than NoOpTransformer since we
3641 // want to handle this differently in the caller.
3742 // FIXME: We need to implement a transformer for this. Currently we're
3843 // relying on CCO to do the heavy lifting for us.
39- return nil , nil
44+ return nil , true , nil
4045 case configv1 .AzurePlatformType :
4146 // We intentionally return nil rather than NoOpTransformer since we
4247 // want to handle this differently in the caller.
4348 // FIXME: We need to implement a transformer for this. Currently we're
4449 // relying on CCO to do the heavy lifting for us.
45- return nil , nil
50+ return nil , true , nil
4651 case configv1 .GCPPlatformType :
47- return common .NoOpTransformer , nil
52+ return common .NoOpTransformer , false , nil
4853 case configv1 .IBMCloudPlatformType :
49- return common .NoOpTransformer , nil
54+ return common .NoOpTransformer , false , nil
5055 case configv1 .OpenStackPlatformType :
51- return openstack .CloudConfigTransformer , nil
56+ return openstack .CloudConfigTransformer , false , nil
5257 case configv1 .PowerVSPlatformType :
5358 //Power VS platform uses ibm cloud provider
54- return common .NoOpTransformer , nil
59+ return common .NoOpTransformer , false , nil
5560 case configv1 .VSpherePlatformType :
56- return vsphere .CloudConfigTransformer , nil
61+ return vsphere .CloudConfigTransformer , false , nil
5762 case configv1 .NutanixPlatformType :
58- return common .NoOpTransformer , nil
63+ return common .NoOpTransformer , false , nil
5964 default :
60- return nil , newPlatformNotFoundError (platformStatus .Type )
65+ return nil , false , newPlatformNotFoundError (platformStatus .Type )
6166 }
6267}
6368
0 commit comments