@@ -17,6 +17,12 @@ limitations under the License.
1717package converters
1818
1919import (
20+ // NOTE: when the hub API version is updated, verify the
21+ // ManagedClusterAgentPoolProfile below has every field defined. If a field
22+ // isn't defined, the agent pool will be created with a zero/null value, and
23+ // then updated to the user-defined value. If the field is immutable, this
24+ // update will fail. The linter should catch if there are missing fields,
25+ // but verify that check is actually working.
2026 asocontainerservicev1hub "github.com/Azure/azure-service-operator/v2/api/containerservice/v1api20240901/storage"
2127 "k8s.io/utils/ptr"
2228)
@@ -25,37 +31,50 @@ import (
2531func AgentPoolToManagedClusterAgentPoolProfile (pool * asocontainerservicev1hub.ManagedClustersAgentPool ) asocontainerservicev1hub.ManagedClusterAgentPoolProfile {
2632 properties := pool .Spec
2733 agentPool := asocontainerservicev1hub.ManagedClusterAgentPoolProfile {
28- Name : ptr .To (pool .AzureName ()),
29- VmSize : properties .VmSize ,
30- OsType : properties .OsType ,
31- OsDiskSizeGB : properties .OsDiskSizeGB ,
32- Count : properties .Count ,
33- Type : properties .Type ,
34- OrchestratorVersion : properties .OrchestratorVersion ,
35- VnetSubnetReference : properties .VnetSubnetReference ,
36- Mode : properties .Mode ,
37- EnableAutoScaling : properties .EnableAutoScaling ,
38- MaxCount : properties .MaxCount ,
39- MinCount : properties .MinCount ,
40- NodeTaints : properties .NodeTaints ,
41- AvailabilityZones : properties .AvailabilityZones ,
42- MaxPods : properties .MaxPods ,
43- OsDiskType : properties .OsDiskType ,
44- NodeLabels : properties .NodeLabels ,
45- EnableUltraSSD : properties .EnableUltraSSD ,
46- EnableNodePublicIP : properties .EnableNodePublicIP ,
47- NodePublicIPPrefixReference : properties .NodePublicIPPrefixReference ,
48- ScaleSetPriority : properties .ScaleSetPriority ,
49- ScaleDownMode : properties .ScaleDownMode ,
50- SpotMaxPrice : properties .SpotMaxPrice ,
51- Tags : properties .Tags ,
52- KubeletDiskType : properties .KubeletDiskType ,
53- LinuxOSConfig : properties .LinuxOSConfig ,
54- EnableFIPS : properties .EnableFIPS ,
55- EnableEncryptionAtHost : properties .EnableEncryptionAtHost ,
56- }
57- if properties .KubeletConfig != nil {
58- agentPool .KubeletConfig = properties .KubeletConfig
34+ AvailabilityZones : properties .AvailabilityZones ,
35+ CapacityReservationGroupReference : properties .CapacityReservationGroupReference ,
36+ Count : properties .Count ,
37+ CreationData : properties .CreationData ,
38+ EnableAutoScaling : properties .EnableAutoScaling ,
39+ EnableEncryptionAtHost : properties .EnableEncryptionAtHost ,
40+ EnableFIPS : properties .EnableFIPS ,
41+ EnableNodePublicIP : properties .EnableNodePublicIP ,
42+ EnableUltraSSD : properties .EnableUltraSSD ,
43+ GpuInstanceProfile : properties .GpuInstanceProfile ,
44+ HostGroupReference : properties .HostGroupReference ,
45+ KubeletConfig : properties .KubeletConfig ,
46+ KubeletDiskType : properties .KubeletDiskType ,
47+ LinuxOSConfig : properties .LinuxOSConfig ,
48+ MaxCount : properties .MaxCount ,
49+ MaxPods : properties .MaxPods ,
50+ MinCount : properties .MinCount ,
51+ Mode : properties .Mode ,
52+ Name : ptr .To (pool .AzureName ()),
53+ NetworkProfile : properties .NetworkProfile ,
54+ NodeLabels : properties .NodeLabels ,
55+ NodePublicIPPrefixReference : properties .NodePublicIPPrefixReference ,
56+ NodeTaints : properties .NodeTaints ,
57+ OrchestratorVersion : properties .OrchestratorVersion ,
58+ OsDiskSizeGB : properties .OsDiskSizeGB ,
59+ OsDiskType : properties .OsDiskType ,
60+ OsSKU : properties .OsSKU ,
61+ OsType : properties .OsType ,
62+ PodSubnetReference : properties .PodSubnetReference ,
63+ PowerState : properties .PowerState ,
64+ PropertyBag : properties .PropertyBag ,
65+ ProximityPlacementGroupReference : properties .ProximityPlacementGroupReference ,
66+ ScaleDownMode : properties .ScaleDownMode ,
67+ ScaleSetEvictionPolicy : properties .ScaleSetEvictionPolicy ,
68+ ScaleSetPriority : properties .ScaleSetPriority ,
69+ SecurityProfile : properties .SecurityProfile ,
70+ SpotMaxPrice : properties .SpotMaxPrice ,
71+ Tags : properties .Tags ,
72+ Type : properties .Type ,
73+ UpgradeSettings : properties .UpgradeSettings ,
74+ VmSize : properties .VmSize ,
75+ VnetSubnetReference : properties .VnetSubnetReference ,
76+ WindowsProfile : properties .WindowsProfile ,
77+ WorkloadRuntime : properties .WorkloadRuntime ,
5978 }
6079 return agentPool
6180}
0 commit comments