@@ -20,9 +20,9 @@ import (
20
20
"encoding/json"
21
21
"fmt"
22
22
23
- "k8c.io/machine-controller/pkg /apis/cluster/common"
24
- "k8c.io/machine-controller/pkg /apis/cluster/v1alpha1"
25
- providerconfigtypes "k8c.io/machine-controller/pkg /providerconfig/types "
23
+ "k8c.io/machine-controller/sdk /apis/cluster/common"
24
+ clusterv1alpha1 "k8c.io/machine-controller/sdk /apis/cluster/v1alpha1"
25
+ providerconfigtypes "k8c.io/machine-controller/sdk /providerconfig"
26
26
27
27
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
28
28
metav1validation "k8s.io/apimachinery/pkg/apis/meta/v1/validation"
@@ -32,13 +32,13 @@ import (
32
32
"k8s.io/apimachinery/pkg/util/validation/field"
33
33
)
34
34
35
- func validateMachineDeployment (md v1alpha1 .MachineDeployment ) field.ErrorList {
35
+ func validateMachineDeployment (md clusterv1alpha1 .MachineDeployment ) field.ErrorList {
36
36
allErrs := field.ErrorList {}
37
37
allErrs = append (allErrs , validateMachineDeploymentSpec (& md .Spec , field .NewPath ("spec" ))... )
38
38
return allErrs
39
39
}
40
40
41
- func validateMachineDeploymentSpec (spec * v1alpha1 .MachineDeploymentSpec , fldPath * field.Path ) field.ErrorList {
41
+ func validateMachineDeploymentSpec (spec * clusterv1alpha1 .MachineDeploymentSpec , fldPath * field.Path ) field.ErrorList {
42
42
allErrs := field.ErrorList {}
43
43
allErrs = append (allErrs , metav1validation .ValidateLabelSelector (& spec .Selector , metav1validation.LabelSelectorValidationOptions {}, fldPath .Child ("selector" ))... )
44
44
if len (spec .Selector .MatchLabels )+ len (spec .Selector .MatchExpressions ) == 0 {
@@ -60,7 +60,7 @@ func validateMachineDeploymentSpec(spec *v1alpha1.MachineDeploymentSpec, fldPath
60
60
return allErrs
61
61
}
62
62
63
- func validateMachineDeploymentStrategy (strategy * v1alpha1 .MachineDeploymentStrategy , fldPath * field.Path ) field.ErrorList {
63
+ func validateMachineDeploymentStrategy (strategy * clusterv1alpha1 .MachineDeploymentStrategy , fldPath * field.Path ) field.ErrorList {
64
64
allErrs := field.ErrorList {}
65
65
switch strategy .Type {
66
66
case common .RollingUpdateMachineDeploymentStrategyType :
@@ -73,7 +73,7 @@ func validateMachineDeploymentStrategy(strategy *v1alpha1.MachineDeploymentStrat
73
73
return allErrs
74
74
}
75
75
76
- func validateMachineRollingUpdateDeployment (rollingUpdate * v1alpha1 .MachineRollingUpdateDeployment , fldPath * field.Path ) field.ErrorList {
76
+ func validateMachineRollingUpdateDeployment (rollingUpdate * clusterv1alpha1 .MachineRollingUpdateDeployment , fldPath * field.Path ) field.ErrorList {
77
77
allErrs := field.ErrorList {}
78
78
var maxUnavailable int
79
79
var maxSurge int
@@ -110,11 +110,11 @@ func getIntOrPercent(s *intstr.IntOrString, roundUp bool) (int, error) {
110
110
return intstr .GetValueFromIntOrPercent (s , 100 , roundUp )
111
111
}
112
112
113
- func machineDeploymentDefaultingFunction (md * v1alpha1 .MachineDeployment ) {
114
- v1alpha1 .PopulateDefaultsMachineDeployment (md )
113
+ func machineDeploymentDefaultingFunction (md * clusterv1alpha1 .MachineDeployment ) {
114
+ clusterv1alpha1 .PopulateDefaultsMachineDeployment (md )
115
115
}
116
116
117
- func mutationsForMachineDeployment (md * v1alpha1 .MachineDeployment ) error {
117
+ func mutationsForMachineDeployment (md * clusterv1alpha1 .MachineDeployment ) error {
118
118
providerConfig , err := providerconfigtypes .GetConfig (md .Spec .Template .Spec .ProviderSpec )
119
119
if err != nil {
120
120
return fmt .Errorf ("failed to read MachineDeployment.Spec.Template.Spec.ProviderSpec: %w" , err )
0 commit comments