@@ -27,10 +27,10 @@ import (
2727)
2828
2929type ClusterIface interface {
30- GetOrCreateCluster (* clusterv1.Cluster , * infrav1.CloudStackCluster , * infrav1.CloudStackFailureDomainSpec ) error
31- DeleteCluster (* infrav1.CloudStackCluster ) error
32- AddVMToCluster (* infrav1.CloudStackCluster , * infrav1.CloudStackMachine ) error
33- RemoveVMFromCluster (* infrav1.CloudStackCluster , * infrav1.CloudStackMachine ) error
30+ GetOrCreateUnmanagedCluster (* clusterv1.Cluster , * infrav1.CloudStackCluster , * infrav1.CloudStackFailureDomainSpec ) error
31+ DeleteUnmanagedCluster (* infrav1.CloudStackCluster ) error
32+ AddVMToUnmanagedCluster (* infrav1.CloudStackCluster , * infrav1.CloudStackMachine ) error
33+ RemoveVMFromUnmanagedCluster (* infrav1.CloudStackCluster , * infrav1.CloudStackMachine ) error
3434}
3535
3636type ClustertypeSetter interface {
@@ -48,7 +48,7 @@ func withExternalManaged() cloudstack.OptionFunc {
4848 }
4949}
5050
51- func (c * client ) GetOrCreateCluster (cluster * clusterv1.Cluster , csCluster * infrav1.CloudStackCluster , fd * infrav1.CloudStackFailureDomainSpec ) error {
51+ func (c * client ) GetOrCreateUnmanagedCluster (cluster * clusterv1.Cluster , csCluster * infrav1.CloudStackCluster , fd * infrav1.CloudStackFailureDomainSpec ) error {
5252 // Get cluster
5353 if csCluster .Status .CloudStackClusterID != "" {
5454 externalManagedCluster , count , err := c .cs .Kubernetes .GetKubernetesClusterByID (csCluster .Status .CloudStackClusterID , withExternalManaged ())
@@ -102,7 +102,7 @@ func (c *client) GetOrCreateCluster(cluster *clusterv1.Cluster, csCluster *infra
102102 return nil
103103}
104104
105- func (c * client ) DeleteCluster (csCluster * infrav1.CloudStackCluster ) error {
105+ func (c * client ) DeleteUnmanagedCluster (csCluster * infrav1.CloudStackCluster ) error {
106106 if csCluster .Status .CloudStackClusterID != "" {
107107 csUnmanagedCluster , count , err := c .cs .Kubernetes .GetKubernetesClusterByID (csCluster .Status .CloudStackClusterID , withExternalManaged ())
108108 if err != nil && strings .Contains (err .Error (), " not found" ) {
@@ -120,7 +120,7 @@ func (c *client) DeleteCluster(csCluster *infrav1.CloudStackCluster) error {
120120 return nil
121121}
122122
123- func (c * client ) AddVMToCluster (csCluster * infrav1.CloudStackCluster , csMachine * infrav1.CloudStackMachine ) error {
123+ func (c * client ) AddVMToUnmanagedCluster (csCluster * infrav1.CloudStackCluster , csMachine * infrav1.CloudStackMachine ) error {
124124 if csCluster .Status .CloudStackClusterID != "" {
125125 params := c .cs .Kubernetes .NewAddVirtualMachinesToKubernetesClusterParams (csCluster .Status .CloudStackClusterID , []string {* csMachine .Spec .InstanceID })
126126 _ , err := c .cs .Kubernetes .AddVirtualMachinesToKubernetesCluster (params )
@@ -129,7 +129,7 @@ func (c *client) AddVMToCluster(csCluster *infrav1.CloudStackCluster, csMachine
129129 return nil
130130}
131131
132- func (c * client ) RemoveVMFromCluster (csCluster * infrav1.CloudStackCluster , csMachine * infrav1.CloudStackMachine ) error {
132+ func (c * client ) RemoveVMFromUnmanagedCluster (csCluster * infrav1.CloudStackCluster , csMachine * infrav1.CloudStackMachine ) error {
133133 if csCluster .Status .CloudStackClusterID != "" {
134134 params := c .cs .Kubernetes .NewRemoveVirtualMachinesFromKubernetesClusterParams (csCluster .Status .CloudStackClusterID , []string {* csMachine .Spec .InstanceID })
135135 _ , err := c .cs .Kubernetes .RemoveVirtualMachinesFromKubernetesCluster (params )
0 commit comments