@@ -27,10 +27,10 @@ import (
27
27
)
28
28
29
29
type 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
34
34
}
35
35
36
36
type ClustertypeSetter interface {
@@ -48,7 +48,7 @@ func withExternalManaged() cloudstack.OptionFunc {
48
48
}
49
49
}
50
50
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 {
52
52
// Get cluster
53
53
if csCluster .Status .CloudStackClusterID != "" {
54
54
externalManagedCluster , count , err := c .cs .Kubernetes .GetKubernetesClusterByID (csCluster .Status .CloudStackClusterID , withExternalManaged ())
@@ -102,7 +102,7 @@ func (c *client) GetOrCreateCluster(cluster *clusterv1.Cluster, csCluster *infra
102
102
return nil
103
103
}
104
104
105
- func (c * client ) DeleteCluster (csCluster * infrav1.CloudStackCluster ) error {
105
+ func (c * client ) DeleteUnmanagedCluster (csCluster * infrav1.CloudStackCluster ) error {
106
106
if csCluster .Status .CloudStackClusterID != "" {
107
107
csUnmanagedCluster , count , err := c .cs .Kubernetes .GetKubernetesClusterByID (csCluster .Status .CloudStackClusterID , withExternalManaged ())
108
108
if err != nil && strings .Contains (err .Error (), " not found" ) {
@@ -120,7 +120,7 @@ func (c *client) DeleteCluster(csCluster *infrav1.CloudStackCluster) error {
120
120
return nil
121
121
}
122
122
123
- func (c * client ) AddVMToCluster (csCluster * infrav1.CloudStackCluster , csMachine * infrav1.CloudStackMachine ) error {
123
+ func (c * client ) AddVMToUnmanagedCluster (csCluster * infrav1.CloudStackCluster , csMachine * infrav1.CloudStackMachine ) error {
124
124
if csCluster .Status .CloudStackClusterID != "" {
125
125
params := c .cs .Kubernetes .NewAddVirtualMachinesToKubernetesClusterParams (csCluster .Status .CloudStackClusterID , []string {* csMachine .Spec .InstanceID })
126
126
_ , err := c .cs .Kubernetes .AddVirtualMachinesToKubernetesCluster (params )
@@ -129,7 +129,7 @@ func (c *client) AddVMToCluster(csCluster *infrav1.CloudStackCluster, csMachine
129
129
return nil
130
130
}
131
131
132
- func (c * client ) RemoveVMFromCluster (csCluster * infrav1.CloudStackCluster , csMachine * infrav1.CloudStackMachine ) error {
132
+ func (c * client ) RemoveVMFromUnmanagedCluster (csCluster * infrav1.CloudStackCluster , csMachine * infrav1.CloudStackMachine ) error {
133
133
if csCluster .Status .CloudStackClusterID != "" {
134
134
params := c .cs .Kubernetes .NewRemoveVirtualMachinesFromKubernetesClusterParams (csCluster .Status .CloudStackClusterID , []string {* csMachine .Spec .InstanceID })
135
135
_ , err := c .cs .Kubernetes .RemoveVirtualMachinesFromKubernetesCluster (params )
0 commit comments