diff --git a/v2/api/containerservice/v1api20210501/managed_cluster_status_arm_types_gen.go b/v2/api/containerservice/v1api20210501/managed_cluster_status_arm_types_gen.go index 2283686fd5d..52723c7039c 100644 --- a/v2/api/containerservice/v1api20210501/managed_cluster_status_arm_types_gen.go +++ b/v2/api/containerservice/v1api20210501/managed_cluster_status_arm_types_gen.go @@ -578,18 +578,6 @@ var managedClusterSKU_Tier_STATUS_Values = map[string]ManagedClusterSKU_Tier_STA // Profile for Windows VMs in the managed cluster. type ManagedClusterWindowsProfile_STATUS_ARM struct { - // AdminPassword: Specifies the password of the administrator account. - // Minimum-length: 8 characters - // Max-length: 123 characters - // Complexity requirements: 3 out of 4 conditions below need to be fulfilled - // Has lower characters - // Has upper characters - // Has a digit - // Has a special character (Regex match [\W_]) - // Disallowed values: "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", - // "Password22", "iloveyou!" - AdminPassword *string `json:"adminPassword,omitempty"` - // AdminUsername: Specifies the name of the administrator account. // Restriction: Cannot end in "." // Disallowed values: "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", diff --git a/v2/api/containerservice/v1api20210501/managed_cluster_status_arm_types_gen_test.go b/v2/api/containerservice/v1api20210501/managed_cluster_status_arm_types_gen_test.go index 4f6d795d4bd..bc65899b797 100644 --- a/v2/api/containerservice/v1api20210501/managed_cluster_status_arm_types_gen_test.go +++ b/v2/api/containerservice/v1api20210501/managed_cluster_status_arm_types_gen_test.go @@ -2074,7 +2074,6 @@ func ManagedClusterWindowsProfile_STATUS_ARMGenerator() gopter.Gen { // AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile_STATUS_ARM is a factory method for creating gopter generators func AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile_STATUS_ARM(gens map[string]gopter.Gen) { - gens["AdminPassword"] = gen.PtrOf(gen.AlphaString()) gens["AdminUsername"] = gen.PtrOf(gen.AlphaString()) gens["EnableCSIProxy"] = gen.PtrOf(gen.Bool()) gens["LicenseType"] = gen.PtrOf(gen.OneConstOf(ManagedClusterWindowsProfile_LicenseType_STATUS_None, ManagedClusterWindowsProfile_LicenseType_STATUS_Windows_Server)) diff --git a/v2/api/containerservice/v1api20210501/managed_cluster_types_gen.go b/v2/api/containerservice/v1api20210501/managed_cluster_types_gen.go index 56d9beea22f..8afbc317464 100644 --- a/v2/api/containerservice/v1api20210501/managed_cluster_types_gen.go +++ b/v2/api/containerservice/v1api20210501/managed_cluster_types_gen.go @@ -9249,7 +9249,7 @@ type ManagedClusterWindowsProfile struct { // Has a special character (Regex match [\W_]) // Disallowed values: "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", // "Password22", "iloveyou!" - AdminPassword *string `json:"adminPassword,omitempty"` + AdminPassword *genruntime.SecretReference `json:"adminPassword,omitempty"` // +kubebuilder:validation:Required // AdminUsername: Specifies the name of the administrator account. @@ -9281,7 +9281,11 @@ func (profile *ManagedClusterWindowsProfile) ConvertToARM(resolved genruntime.Co // Set property "AdminPassword": if profile.AdminPassword != nil { - adminPassword := *profile.AdminPassword + adminPasswordSecret, err := resolved.ResolvedSecrets.Lookup(*profile.AdminPassword) + if err != nil { + return nil, errors.Wrap(err, "looking up secret for property AdminPassword") + } + adminPassword := adminPasswordSecret result.AdminPassword = &adminPassword } @@ -9317,11 +9321,7 @@ func (profile *ManagedClusterWindowsProfile) PopulateFromARM(owner genruntime.Ar return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected ManagedClusterWindowsProfile_ARM, got %T", armInput) } - // Set property "AdminPassword": - if typedInput.AdminPassword != nil { - adminPassword := *typedInput.AdminPassword - profile.AdminPassword = &adminPassword - } + // no assignment for property "AdminPassword" // Set property "AdminUsername": if typedInput.AdminUsername != nil { @@ -9349,7 +9349,12 @@ func (profile *ManagedClusterWindowsProfile) PopulateFromARM(owner genruntime.Ar func (profile *ManagedClusterWindowsProfile) AssignProperties_From_ManagedClusterWindowsProfile(source *storage.ManagedClusterWindowsProfile) error { // AdminPassword - profile.AdminPassword = genruntime.ClonePointerToString(source.AdminPassword) + if source.AdminPassword != nil { + adminPassword := source.AdminPassword.Copy() + profile.AdminPassword = &adminPassword + } else { + profile.AdminPassword = nil + } // AdminUsername profile.AdminUsername = genruntime.ClonePointerToString(source.AdminUsername) @@ -9381,7 +9386,12 @@ func (profile *ManagedClusterWindowsProfile) AssignProperties_To_ManagedClusterW propertyBag := genruntime.NewPropertyBag() // AdminPassword - destination.AdminPassword = genruntime.ClonePointerToString(profile.AdminPassword) + if profile.AdminPassword != nil { + adminPassword := profile.AdminPassword.Copy() + destination.AdminPassword = &adminPassword + } else { + destination.AdminPassword = nil + } // AdminUsername destination.AdminUsername = genruntime.ClonePointerToString(profile.AdminUsername) @@ -9415,18 +9425,6 @@ func (profile *ManagedClusterWindowsProfile) AssignProperties_To_ManagedClusterW // Profile for Windows VMs in the managed cluster. type ManagedClusterWindowsProfile_STATUS struct { - // AdminPassword: Specifies the password of the administrator account. - // Minimum-length: 8 characters - // Max-length: 123 characters - // Complexity requirements: 3 out of 4 conditions below need to be fulfilled - // Has lower characters - // Has upper characters - // Has a digit - // Has a special character (Regex match [\W_]) - // Disallowed values: "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", - // "Password22", "iloveyou!" - AdminPassword *string `json:"adminPassword,omitempty"` - // AdminUsername: Specifies the name of the administrator account. // Restriction: Cannot end in "." // Disallowed values: "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", @@ -9459,12 +9457,6 @@ func (profile *ManagedClusterWindowsProfile_STATUS) PopulateFromARM(owner genrun return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected ManagedClusterWindowsProfile_STATUS_ARM, got %T", armInput) } - // Set property "AdminPassword": - if typedInput.AdminPassword != nil { - adminPassword := *typedInput.AdminPassword - profile.AdminPassword = &adminPassword - } - // Set property "AdminUsername": if typedInput.AdminUsername != nil { adminUsername := *typedInput.AdminUsername @@ -9490,9 +9482,6 @@ func (profile *ManagedClusterWindowsProfile_STATUS) PopulateFromARM(owner genrun // AssignProperties_From_ManagedClusterWindowsProfile_STATUS populates our ManagedClusterWindowsProfile_STATUS from the provided source ManagedClusterWindowsProfile_STATUS func (profile *ManagedClusterWindowsProfile_STATUS) AssignProperties_From_ManagedClusterWindowsProfile_STATUS(source *storage.ManagedClusterWindowsProfile_STATUS) error { - // AdminPassword - profile.AdminPassword = genruntime.ClonePointerToString(source.AdminPassword) - // AdminUsername profile.AdminUsername = genruntime.ClonePointerToString(source.AdminUsername) @@ -9522,9 +9511,6 @@ func (profile *ManagedClusterWindowsProfile_STATUS) AssignProperties_To_ManagedC // Create a new property bag propertyBag := genruntime.NewPropertyBag() - // AdminPassword - destination.AdminPassword = genruntime.ClonePointerToString(profile.AdminPassword) - // AdminUsername destination.AdminUsername = genruntime.ClonePointerToString(profile.AdminUsername) diff --git a/v2/api/containerservice/v1api20210501/managed_cluster_types_gen_test.go b/v2/api/containerservice/v1api20210501/managed_cluster_types_gen_test.go index 44ce8572b69..3af4552b162 100644 --- a/v2/api/containerservice/v1api20210501/managed_cluster_types_gen_test.go +++ b/v2/api/containerservice/v1api20210501/managed_cluster_types_gen_test.go @@ -5957,7 +5957,6 @@ func ManagedClusterWindowsProfileGenerator() gopter.Gen { // AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile is a factory method for creating gopter generators func AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile(gens map[string]gopter.Gen) { - gens["AdminPassword"] = gen.PtrOf(gen.AlphaString()) gens["AdminUsername"] = gen.PtrOf(gen.AlphaString()) gens["EnableCSIProxy"] = gen.PtrOf(gen.Bool()) gens["LicenseType"] = gen.PtrOf(gen.OneConstOf(ManagedClusterWindowsProfile_LicenseType_None, ManagedClusterWindowsProfile_LicenseType_Windows_Server)) @@ -6063,7 +6062,6 @@ func ManagedClusterWindowsProfile_STATUSGenerator() gopter.Gen { // AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile_STATUS is a factory method for creating gopter generators func AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile_STATUS(gens map[string]gopter.Gen) { - gens["AdminPassword"] = gen.PtrOf(gen.AlphaString()) gens["AdminUsername"] = gen.PtrOf(gen.AlphaString()) gens["EnableCSIProxy"] = gen.PtrOf(gen.Bool()) gens["LicenseType"] = gen.PtrOf(gen.OneConstOf(ManagedClusterWindowsProfile_LicenseType_STATUS_None, ManagedClusterWindowsProfile_LicenseType_STATUS_Windows_Server)) diff --git a/v2/api/containerservice/v1api20210501/storage/managed_cluster_types_gen.go b/v2/api/containerservice/v1api20210501/storage/managed_cluster_types_gen.go index ad5ba692364..b1f69466672 100644 --- a/v2/api/containerservice/v1api20210501/storage/managed_cluster_types_gen.go +++ b/v2/api/containerservice/v1api20210501/storage/managed_cluster_types_gen.go @@ -6388,11 +6388,11 @@ func (clusterSKU *ManagedClusterSKU_STATUS) AssignProperties_To_ManagedClusterSK // Storage version of v1api20210501.ManagedClusterWindowsProfile // Profile for Windows VMs in the managed cluster. type ManagedClusterWindowsProfile struct { - AdminPassword *string `json:"adminPassword,omitempty"` - AdminUsername *string `json:"adminUsername,omitempty"` - EnableCSIProxy *bool `json:"enableCSIProxy,omitempty"` - LicenseType *string `json:"licenseType,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + AdminPassword *genruntime.SecretReference `json:"adminPassword,omitempty"` + AdminUsername *string `json:"adminUsername,omitempty"` + EnableCSIProxy *bool `json:"enableCSIProxy,omitempty"` + LicenseType *string `json:"licenseType,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` } // AssignProperties_From_ManagedClusterWindowsProfile populates our ManagedClusterWindowsProfile from the provided source ManagedClusterWindowsProfile @@ -6401,7 +6401,12 @@ func (profile *ManagedClusterWindowsProfile) AssignProperties_From_ManagedCluste propertyBag := genruntime.NewPropertyBag(source.PropertyBag) // AdminPassword - profile.AdminPassword = genruntime.ClonePointerToString(source.AdminPassword) + if source.AdminPassword != nil { + adminPassword := source.AdminPassword.Copy() + profile.AdminPassword = &adminPassword + } else { + profile.AdminPassword = nil + } // AdminUsername profile.AdminUsername = genruntime.ClonePointerToString(source.AdminUsername) @@ -6450,7 +6455,12 @@ func (profile *ManagedClusterWindowsProfile) AssignProperties_To_ManagedClusterW propertyBag := genruntime.NewPropertyBag(profile.PropertyBag) // AdminPassword - destination.AdminPassword = genruntime.ClonePointerToString(profile.AdminPassword) + if profile.AdminPassword != nil { + adminPassword := profile.AdminPassword.Copy() + destination.AdminPassword = &adminPassword + } else { + destination.AdminPassword = nil + } // AdminUsername destination.AdminUsername = genruntime.ClonePointerToString(profile.AdminUsername) @@ -6502,7 +6512,6 @@ func (profile *ManagedClusterWindowsProfile) AssignProperties_To_ManagedClusterW // Storage version of v1api20210501.ManagedClusterWindowsProfile_STATUS // Profile for Windows VMs in the managed cluster. type ManagedClusterWindowsProfile_STATUS struct { - AdminPassword *string `json:"adminPassword,omitempty"` AdminUsername *string `json:"adminUsername,omitempty"` EnableCSIProxy *bool `json:"enableCSIProxy,omitempty"` LicenseType *string `json:"licenseType,omitempty"` @@ -6514,9 +6523,6 @@ func (profile *ManagedClusterWindowsProfile_STATUS) AssignProperties_From_Manage // Clone the existing property bag propertyBag := genruntime.NewPropertyBag(source.PropertyBag) - // AdminPassword - profile.AdminPassword = genruntime.ClonePointerToString(source.AdminPassword) - // AdminUsername profile.AdminUsername = genruntime.ClonePointerToString(source.AdminUsername) @@ -6563,9 +6569,6 @@ func (profile *ManagedClusterWindowsProfile_STATUS) AssignProperties_To_ManagedC // Clone the existing property bag propertyBag := genruntime.NewPropertyBag(profile.PropertyBag) - // AdminPassword - destination.AdminPassword = genruntime.ClonePointerToString(profile.AdminPassword) - // AdminUsername destination.AdminUsername = genruntime.ClonePointerToString(profile.AdminUsername) diff --git a/v2/api/containerservice/v1api20210501/storage/managed_cluster_types_gen_test.go b/v2/api/containerservice/v1api20210501/storage/managed_cluster_types_gen_test.go index e9d9b34fd5e..27b29b177fd 100644 --- a/v2/api/containerservice/v1api20210501/storage/managed_cluster_types_gen_test.go +++ b/v2/api/containerservice/v1api20210501/storage/managed_cluster_types_gen_test.go @@ -5923,7 +5923,6 @@ func ManagedClusterWindowsProfileGenerator() gopter.Gen { // AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile is a factory method for creating gopter generators func AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile(gens map[string]gopter.Gen) { - gens["AdminPassword"] = gen.PtrOf(gen.AlphaString()) gens["AdminUsername"] = gen.PtrOf(gen.AlphaString()) gens["EnableCSIProxy"] = gen.PtrOf(gen.Bool()) gens["LicenseType"] = gen.PtrOf(gen.AlphaString()) @@ -6029,7 +6028,6 @@ func ManagedClusterWindowsProfile_STATUSGenerator() gopter.Gen { // AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile_STATUS is a factory method for creating gopter generators func AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile_STATUS(gens map[string]gopter.Gen) { - gens["AdminPassword"] = gen.PtrOf(gen.AlphaString()) gens["AdminUsername"] = gen.PtrOf(gen.AlphaString()) gens["EnableCSIProxy"] = gen.PtrOf(gen.Bool()) gens["LicenseType"] = gen.PtrOf(gen.AlphaString()) diff --git a/v2/api/containerservice/v1api20210501/storage/structure.txt b/v2/api/containerservice/v1api20210501/storage/structure.txt index be00e790143..2ab1624646e 100644 --- a/v2/api/containerservice/v1api20210501/storage/structure.txt +++ b/v2/api/containerservice/v1api20210501/storage/structure.txt @@ -246,7 +246,7 @@ ManagedCluster: Resource │ │ └── Tier: *string │ ├── Tags: map[string]string │ └── WindowsProfile: *Object (5 properties) -│ ├── AdminPassword: *string +│ ├── AdminPassword: *genruntime.SecretReference │ ├── AdminUsername: *string │ ├── EnableCSIProxy: *bool │ ├── LicenseType: *string @@ -522,8 +522,7 @@ ManagedCluster: Resource │ └── Tier: *string ├── Tags: map[string]string ├── Type: *string - └── WindowsProfile: *Object (5 properties) - ├── AdminPassword: *string + └── WindowsProfile: *Object (4 properties) ├── AdminUsername: *string ├── EnableCSIProxy: *bool ├── LicenseType: *string diff --git a/v2/api/containerservice/v1api20210501/storage/zz_generated.deepcopy.go b/v2/api/containerservice/v1api20210501/storage/zz_generated.deepcopy.go index 38c87589128..fb8cd5db5b4 100644 --- a/v2/api/containerservice/v1api20210501/storage/zz_generated.deepcopy.go +++ b/v2/api/containerservice/v1api20210501/storage/zz_generated.deepcopy.go @@ -2754,7 +2754,7 @@ func (in *ManagedClusterWindowsProfile) DeepCopyInto(out *ManagedClusterWindowsP *out = *in if in.AdminPassword != nil { in, out := &in.AdminPassword, &out.AdminPassword - *out = new(string) + *out = new(genruntime.SecretReference) **out = **in } if in.AdminUsername != nil { @@ -2794,11 +2794,6 @@ func (in *ManagedClusterWindowsProfile) DeepCopy() *ManagedClusterWindowsProfile // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ManagedClusterWindowsProfile_STATUS) DeepCopyInto(out *ManagedClusterWindowsProfile_STATUS) { *out = *in - if in.AdminPassword != nil { - in, out := &in.AdminPassword, &out.AdminPassword - *out = new(string) - **out = **in - } if in.AdminUsername != nil { in, out := &in.AdminUsername, &out.AdminUsername *out = new(string) diff --git a/v2/api/containerservice/v1api20210501/structure.txt b/v2/api/containerservice/v1api20210501/structure.txt index 12d57142324..7f88838c1dd 100644 --- a/v2/api/containerservice/v1api20210501/structure.txt +++ b/v2/api/containerservice/v1api20210501/structure.txt @@ -274,7 +274,7 @@ ManagedCluster: Resource │ │ └── "Paid" │ ├── Tags: map[string]string │ └── WindowsProfile: *Object (4 properties) -│ ├── AdminPassword: *string +│ ├── AdminPassword: *genruntime.SecretReference │ ├── AdminUsername: *string │ ├── EnableCSIProxy: *bool │ └── LicenseType: *Enum (2 values) @@ -565,8 +565,7 @@ ManagedCluster: Resource │ └── "Paid" ├── Tags: map[string]string ├── Type: *string - └── WindowsProfile: *Object (4 properties) - ├── AdminPassword: *string + └── WindowsProfile: *Object (3 properties) ├── AdminUsername: *string ├── EnableCSIProxy: *bool └── LicenseType: *Enum (2 values) @@ -849,8 +848,7 @@ ManagedCluster_STATUS_ARM: Object (9 properties) │ ├── ProvisioningState: *string │ ├── ServicePrincipalProfile: *Object (1 property) │ │ └── ClientId: *string -│ └── WindowsProfile: *Object (4 properties) -│ ├── AdminPassword: *string +│ └── WindowsProfile: *Object (3 properties) │ ├── AdminUsername: *string │ ├── EnableCSIProxy: *bool │ └── LicenseType: *Enum (2 values) diff --git a/v2/api/containerservice/v1api20210501/zz_generated.deepcopy.go b/v2/api/containerservice/v1api20210501/zz_generated.deepcopy.go index cd90d518707..2ce99ee985d 100644 --- a/v2/api/containerservice/v1api20210501/zz_generated.deepcopy.go +++ b/v2/api/containerservice/v1api20210501/zz_generated.deepcopy.go @@ -5263,7 +5263,7 @@ func (in *ManagedClusterWindowsProfile) DeepCopyInto(out *ManagedClusterWindowsP *out = *in if in.AdminPassword != nil { in, out := &in.AdminPassword, &out.AdminPassword - *out = new(string) + *out = new(genruntime.SecretReference) **out = **in } if in.AdminUsername != nil { @@ -5331,11 +5331,6 @@ func (in *ManagedClusterWindowsProfile_ARM) DeepCopy() *ManagedClusterWindowsPro // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ManagedClusterWindowsProfile_STATUS) DeepCopyInto(out *ManagedClusterWindowsProfile_STATUS) { *out = *in - if in.AdminPassword != nil { - in, out := &in.AdminPassword, &out.AdminPassword - *out = new(string) - **out = **in - } if in.AdminUsername != nil { in, out := &in.AdminUsername, &out.AdminUsername *out = new(string) @@ -5366,11 +5361,6 @@ func (in *ManagedClusterWindowsProfile_STATUS) DeepCopy() *ManagedClusterWindows // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ManagedClusterWindowsProfile_STATUS_ARM) DeepCopyInto(out *ManagedClusterWindowsProfile_STATUS_ARM) { *out = *in - if in.AdminPassword != nil { - in, out := &in.AdminPassword, &out.AdminPassword - *out = new(string) - **out = **in - } if in.AdminUsername != nil { in, out := &in.AdminUsername, &out.AdminUsername *out = new(string) diff --git a/v2/api/containerservice/v1api20230201/managed_cluster_status_arm_types_gen.go b/v2/api/containerservice/v1api20230201/managed_cluster_status_arm_types_gen.go index 0539f747e13..b39694280de 100644 --- a/v2/api/containerservice/v1api20230201/managed_cluster_status_arm_types_gen.go +++ b/v2/api/containerservice/v1api20230201/managed_cluster_status_arm_types_gen.go @@ -729,18 +729,6 @@ type ManagedClusterStorageProfile_STATUS_ARM struct { // Profile for Windows VMs in the managed cluster. type ManagedClusterWindowsProfile_STATUS_ARM struct { - // AdminPassword: Specifies the password of the administrator account. - // Minimum-length: 8 characters - // Max-length: 123 characters - // Complexity requirements: 3 out of 4 conditions below need to be fulfilled - // Has lower characters - // Has upper characters - // Has a digit - // Has a special character (Regex match [\W_]) - // Disallowed values: "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", - // "Password22", "iloveyou!" - AdminPassword *string `json:"adminPassword,omitempty"` - // AdminUsername: Specifies the name of the administrator account. // Restriction: Cannot end in "." // Disallowed values: "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", diff --git a/v2/api/containerservice/v1api20230201/managed_cluster_status_arm_types_gen_test.go b/v2/api/containerservice/v1api20230201/managed_cluster_status_arm_types_gen_test.go index c9a575ead7a..38ee12b848d 100644 --- a/v2/api/containerservice/v1api20230201/managed_cluster_status_arm_types_gen_test.go +++ b/v2/api/containerservice/v1api20230201/managed_cluster_status_arm_types_gen_test.go @@ -3206,7 +3206,6 @@ func ManagedClusterWindowsProfile_STATUS_ARMGenerator() gopter.Gen { // AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile_STATUS_ARM is a factory method for creating gopter generators func AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile_STATUS_ARM(gens map[string]gopter.Gen) { - gens["AdminPassword"] = gen.PtrOf(gen.AlphaString()) gens["AdminUsername"] = gen.PtrOf(gen.AlphaString()) gens["EnableCSIProxy"] = gen.PtrOf(gen.Bool()) gens["LicenseType"] = gen.PtrOf(gen.OneConstOf(ManagedClusterWindowsProfile_LicenseType_STATUS_None, ManagedClusterWindowsProfile_LicenseType_STATUS_Windows_Server)) diff --git a/v2/api/containerservice/v1api20230201/managed_cluster_types_gen.go b/v2/api/containerservice/v1api20230201/managed_cluster_types_gen.go index 31302648303..59c5683a1b0 100644 --- a/v2/api/containerservice/v1api20230201/managed_cluster_types_gen.go +++ b/v2/api/containerservice/v1api20230201/managed_cluster_types_gen.go @@ -11923,7 +11923,7 @@ type ManagedClusterWindowsProfile struct { // Has a special character (Regex match [\W_]) // Disallowed values: "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", // "Password22", "iloveyou!" - AdminPassword *string `json:"adminPassword,omitempty"` + AdminPassword *genruntime.SecretReference `json:"adminPassword,omitempty"` // +kubebuilder:validation:Required // AdminUsername: Specifies the name of the administrator account. @@ -11958,7 +11958,11 @@ func (profile *ManagedClusterWindowsProfile) ConvertToARM(resolved genruntime.Co // Set property "AdminPassword": if profile.AdminPassword != nil { - adminPassword := *profile.AdminPassword + adminPasswordSecret, err := resolved.ResolvedSecrets.Lookup(*profile.AdminPassword) + if err != nil { + return nil, errors.Wrap(err, "looking up secret for property AdminPassword") + } + adminPassword := adminPasswordSecret result.AdminPassword = &adminPassword } @@ -12004,11 +12008,7 @@ func (profile *ManagedClusterWindowsProfile) PopulateFromARM(owner genruntime.Ar return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected ManagedClusterWindowsProfile_ARM, got %T", armInput) } - // Set property "AdminPassword": - if typedInput.AdminPassword != nil { - adminPassword := *typedInput.AdminPassword - profile.AdminPassword = &adminPassword - } + // no assignment for property "AdminPassword" // Set property "AdminUsername": if typedInput.AdminUsername != nil { @@ -12047,7 +12047,12 @@ func (profile *ManagedClusterWindowsProfile) PopulateFromARM(owner genruntime.Ar func (profile *ManagedClusterWindowsProfile) AssignProperties_From_ManagedClusterWindowsProfile(source *storage.ManagedClusterWindowsProfile) error { // AdminPassword - profile.AdminPassword = genruntime.ClonePointerToString(source.AdminPassword) + if source.AdminPassword != nil { + adminPassword := source.AdminPassword.Copy() + profile.AdminPassword = &adminPassword + } else { + profile.AdminPassword = nil + } // AdminUsername profile.AdminUsername = genruntime.ClonePointerToString(source.AdminUsername) @@ -12091,7 +12096,12 @@ func (profile *ManagedClusterWindowsProfile) AssignProperties_To_ManagedClusterW propertyBag := genruntime.NewPropertyBag() // AdminPassword - destination.AdminPassword = genruntime.ClonePointerToString(profile.AdminPassword) + if profile.AdminPassword != nil { + adminPassword := profile.AdminPassword.Copy() + destination.AdminPassword = &adminPassword + } else { + destination.AdminPassword = nil + } // AdminUsername destination.AdminUsername = genruntime.ClonePointerToString(profile.AdminUsername) @@ -12137,18 +12147,6 @@ func (profile *ManagedClusterWindowsProfile) AssignProperties_To_ManagedClusterW // Profile for Windows VMs in the managed cluster. type ManagedClusterWindowsProfile_STATUS struct { - // AdminPassword: Specifies the password of the administrator account. - // Minimum-length: 8 characters - // Max-length: 123 characters - // Complexity requirements: 3 out of 4 conditions below need to be fulfilled - // Has lower characters - // Has upper characters - // Has a digit - // Has a special character (Regex match [\W_]) - // Disallowed values: "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", - // "Password22", "iloveyou!" - AdminPassword *string `json:"adminPassword,omitempty"` - // AdminUsername: Specifies the name of the administrator account. // Restriction: Cannot end in "." // Disallowed values: "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", @@ -12184,12 +12182,6 @@ func (profile *ManagedClusterWindowsProfile_STATUS) PopulateFromARM(owner genrun return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected ManagedClusterWindowsProfile_STATUS_ARM, got %T", armInput) } - // Set property "AdminPassword": - if typedInput.AdminPassword != nil { - adminPassword := *typedInput.AdminPassword - profile.AdminPassword = &adminPassword - } - // Set property "AdminUsername": if typedInput.AdminUsername != nil { adminUsername := *typedInput.AdminUsername @@ -12226,9 +12218,6 @@ func (profile *ManagedClusterWindowsProfile_STATUS) PopulateFromARM(owner genrun // AssignProperties_From_ManagedClusterWindowsProfile_STATUS populates our ManagedClusterWindowsProfile_STATUS from the provided source ManagedClusterWindowsProfile_STATUS func (profile *ManagedClusterWindowsProfile_STATUS) AssignProperties_From_ManagedClusterWindowsProfile_STATUS(source *storage.ManagedClusterWindowsProfile_STATUS) error { - // AdminPassword - profile.AdminPassword = genruntime.ClonePointerToString(source.AdminPassword) - // AdminUsername profile.AdminUsername = genruntime.ClonePointerToString(source.AdminUsername) @@ -12270,9 +12259,6 @@ func (profile *ManagedClusterWindowsProfile_STATUS) AssignProperties_To_ManagedC // Create a new property bag propertyBag := genruntime.NewPropertyBag() - // AdminPassword - destination.AdminPassword = genruntime.ClonePointerToString(profile.AdminPassword) - // AdminUsername destination.AdminUsername = genruntime.ClonePointerToString(profile.AdminUsername) diff --git a/v2/api/containerservice/v1api20230201/managed_cluster_types_gen_test.go b/v2/api/containerservice/v1api20230201/managed_cluster_types_gen_test.go index 01f17dfbbc9..14bc2b53a44 100644 --- a/v2/api/containerservice/v1api20230201/managed_cluster_types_gen_test.go +++ b/v2/api/containerservice/v1api20230201/managed_cluster_types_gen_test.go @@ -9703,7 +9703,6 @@ func ManagedClusterWindowsProfileGenerator() gopter.Gen { // AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile is a factory method for creating gopter generators func AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile(gens map[string]gopter.Gen) { - gens["AdminPassword"] = gen.PtrOf(gen.AlphaString()) gens["AdminUsername"] = gen.PtrOf(gen.AlphaString()) gens["EnableCSIProxy"] = gen.PtrOf(gen.Bool()) gens["LicenseType"] = gen.PtrOf(gen.OneConstOf(ManagedClusterWindowsProfile_LicenseType_None, ManagedClusterWindowsProfile_LicenseType_Windows_Server)) @@ -9823,7 +9822,6 @@ func ManagedClusterWindowsProfile_STATUSGenerator() gopter.Gen { // AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile_STATUS is a factory method for creating gopter generators func AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile_STATUS(gens map[string]gopter.Gen) { - gens["AdminPassword"] = gen.PtrOf(gen.AlphaString()) gens["AdminUsername"] = gen.PtrOf(gen.AlphaString()) gens["EnableCSIProxy"] = gen.PtrOf(gen.Bool()) gens["LicenseType"] = gen.PtrOf(gen.OneConstOf(ManagedClusterWindowsProfile_LicenseType_STATUS_None, ManagedClusterWindowsProfile_LicenseType_STATUS_Windows_Server)) diff --git a/v2/api/containerservice/v1api20230201/storage/managed_cluster_types_gen.go b/v2/api/containerservice/v1api20230201/storage/managed_cluster_types_gen.go index 74e997cb059..0b94f42b822 100644 --- a/v2/api/containerservice/v1api20230201/storage/managed_cluster_types_gen.go +++ b/v2/api/containerservice/v1api20230201/storage/managed_cluster_types_gen.go @@ -7429,12 +7429,12 @@ func (profile *ManagedClusterStorageProfile_STATUS) AssignProperties_To_ManagedC // Storage version of v1api20230201.ManagedClusterWindowsProfile // Profile for Windows VMs in the managed cluster. type ManagedClusterWindowsProfile struct { - AdminPassword *string `json:"adminPassword,omitempty"` - AdminUsername *string `json:"adminUsername,omitempty"` - EnableCSIProxy *bool `json:"enableCSIProxy,omitempty"` - GmsaProfile *WindowsGmsaProfile `json:"gmsaProfile,omitempty"` - LicenseType *string `json:"licenseType,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + AdminPassword *genruntime.SecretReference `json:"adminPassword,omitempty"` + AdminUsername *string `json:"adminUsername,omitempty"` + EnableCSIProxy *bool `json:"enableCSIProxy,omitempty"` + GmsaProfile *WindowsGmsaProfile `json:"gmsaProfile,omitempty"` + LicenseType *string `json:"licenseType,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` } // AssignProperties_From_ManagedClusterWindowsProfile populates our ManagedClusterWindowsProfile from the provided source ManagedClusterWindowsProfile @@ -7443,7 +7443,12 @@ func (profile *ManagedClusterWindowsProfile) AssignProperties_From_ManagedCluste propertyBag := genruntime.NewPropertyBag(source.PropertyBag) // AdminPassword - profile.AdminPassword = genruntime.ClonePointerToString(source.AdminPassword) + if source.AdminPassword != nil { + adminPassword := source.AdminPassword.Copy() + profile.AdminPassword = &adminPassword + } else { + profile.AdminPassword = nil + } // AdminUsername profile.AdminUsername = genruntime.ClonePointerToString(source.AdminUsername) @@ -7497,7 +7502,12 @@ func (profile *ManagedClusterWindowsProfile) AssignProperties_To_ManagedClusterW propertyBag := genruntime.NewPropertyBag(profile.PropertyBag) // AdminPassword - destination.AdminPassword = genruntime.ClonePointerToString(profile.AdminPassword) + if profile.AdminPassword != nil { + adminPassword := profile.AdminPassword.Copy() + destination.AdminPassword = &adminPassword + } else { + destination.AdminPassword = nil + } // AdminUsername destination.AdminUsername = genruntime.ClonePointerToString(profile.AdminUsername) @@ -7548,7 +7558,6 @@ func (profile *ManagedClusterWindowsProfile) AssignProperties_To_ManagedClusterW // Storage version of v1api20230201.ManagedClusterWindowsProfile_STATUS // Profile for Windows VMs in the managed cluster. type ManagedClusterWindowsProfile_STATUS struct { - AdminPassword *string `json:"adminPassword,omitempty"` AdminUsername *string `json:"adminUsername,omitempty"` EnableCSIProxy *bool `json:"enableCSIProxy,omitempty"` GmsaProfile *WindowsGmsaProfile_STATUS `json:"gmsaProfile,omitempty"` @@ -7561,9 +7570,6 @@ func (profile *ManagedClusterWindowsProfile_STATUS) AssignProperties_From_Manage // Clone the existing property bag propertyBag := genruntime.NewPropertyBag(source.PropertyBag) - // AdminPassword - profile.AdminPassword = genruntime.ClonePointerToString(source.AdminPassword) - // AdminUsername profile.AdminUsername = genruntime.ClonePointerToString(source.AdminUsername) @@ -7615,9 +7621,6 @@ func (profile *ManagedClusterWindowsProfile_STATUS) AssignProperties_To_ManagedC // Clone the existing property bag propertyBag := genruntime.NewPropertyBag(profile.PropertyBag) - // AdminPassword - destination.AdminPassword = genruntime.ClonePointerToString(profile.AdminPassword) - // AdminUsername destination.AdminUsername = genruntime.ClonePointerToString(profile.AdminUsername) diff --git a/v2/api/containerservice/v1api20230201/storage/managed_cluster_types_gen_test.go b/v2/api/containerservice/v1api20230201/storage/managed_cluster_types_gen_test.go index ed45e9d0a46..f21ca37c278 100644 --- a/v2/api/containerservice/v1api20230201/storage/managed_cluster_types_gen_test.go +++ b/v2/api/containerservice/v1api20230201/storage/managed_cluster_types_gen_test.go @@ -9650,7 +9650,6 @@ func ManagedClusterWindowsProfileGenerator() gopter.Gen { // AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile is a factory method for creating gopter generators func AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile(gens map[string]gopter.Gen) { - gens["AdminPassword"] = gen.PtrOf(gen.AlphaString()) gens["AdminUsername"] = gen.PtrOf(gen.AlphaString()) gens["EnableCSIProxy"] = gen.PtrOf(gen.Bool()) gens["LicenseType"] = gen.PtrOf(gen.AlphaString()) @@ -9770,7 +9769,6 @@ func ManagedClusterWindowsProfile_STATUSGenerator() gopter.Gen { // AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile_STATUS is a factory method for creating gopter generators func AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile_STATUS(gens map[string]gopter.Gen) { - gens["AdminPassword"] = gen.PtrOf(gen.AlphaString()) gens["AdminUsername"] = gen.PtrOf(gen.AlphaString()) gens["EnableCSIProxy"] = gen.PtrOf(gen.Bool()) gens["LicenseType"] = gen.PtrOf(gen.AlphaString()) diff --git a/v2/api/containerservice/v1api20230201/storage/structure.txt b/v2/api/containerservice/v1api20230201/storage/structure.txt index 80ae043bc70..7522181f9f2 100644 --- a/v2/api/containerservice/v1api20230201/storage/structure.txt +++ b/v2/api/containerservice/v1api20230201/storage/structure.txt @@ -324,7 +324,7 @@ ManagedCluster: Resource │ │ └── PropertyBag: genruntime.PropertyBag │ ├── Tags: map[string]string │ ├── WindowsProfile: *Object (6 properties) -│ │ ├── AdminPassword: *string +│ │ ├── AdminPassword: *genruntime.SecretReference │ │ ├── AdminUsername: *string │ │ ├── EnableCSIProxy: *bool │ │ ├── GmsaProfile: *Object (4 properties) @@ -692,8 +692,7 @@ ManagedCluster: Resource │ └── PropertyBag: genruntime.PropertyBag ├── Tags: map[string]string ├── Type: *string - ├── WindowsProfile: *Object (6 properties) - │ ├── AdminPassword: *string + ├── WindowsProfile: *Object (5 properties) │ ├── AdminUsername: *string │ ├── EnableCSIProxy: *bool │ ├── GmsaProfile: *Object (4 properties) diff --git a/v2/api/containerservice/v1api20230201/storage/zz_generated.deepcopy.go b/v2/api/containerservice/v1api20230201/storage/zz_generated.deepcopy.go index a75a09e4973..42bb9d7e042 100644 --- a/v2/api/containerservice/v1api20230201/storage/zz_generated.deepcopy.go +++ b/v2/api/containerservice/v1api20230201/storage/zz_generated.deepcopy.go @@ -4062,7 +4062,7 @@ func (in *ManagedClusterWindowsProfile) DeepCopyInto(out *ManagedClusterWindowsP *out = *in if in.AdminPassword != nil { in, out := &in.AdminPassword, &out.AdminPassword - *out = new(string) + *out = new(genruntime.SecretReference) **out = **in } if in.AdminUsername != nil { @@ -4107,11 +4107,6 @@ func (in *ManagedClusterWindowsProfile) DeepCopy() *ManagedClusterWindowsProfile // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ManagedClusterWindowsProfile_STATUS) DeepCopyInto(out *ManagedClusterWindowsProfile_STATUS) { *out = *in - if in.AdminPassword != nil { - in, out := &in.AdminPassword, &out.AdminPassword - *out = new(string) - **out = **in - } if in.AdminUsername != nil { in, out := &in.AdminUsername, &out.AdminUsername *out = new(string) diff --git a/v2/api/containerservice/v1api20230201/structure.txt b/v2/api/containerservice/v1api20230201/structure.txt index cb768dab566..7a85338304f 100644 --- a/v2/api/containerservice/v1api20230201/structure.txt +++ b/v2/api/containerservice/v1api20230201/structure.txt @@ -358,7 +358,7 @@ ManagedCluster: Resource │ │ └── Enabled: *bool │ ├── Tags: map[string]string │ ├── WindowsProfile: *Object (5 properties) -│ │ ├── AdminPassword: *string +│ │ ├── AdminPassword: *genruntime.SecretReference │ │ ├── AdminUsername: *string │ │ ├── EnableCSIProxy: *bool │ │ ├── GmsaProfile: *Object (3 properties) @@ -747,8 +747,7 @@ ManagedCluster: Resource │ └── "User" ├── Tags: map[string]string ├── Type: *string - ├── WindowsProfile: *Object (5 properties) - │ ├── AdminPassword: *string + ├── WindowsProfile: *Object (4 properties) │ ├── AdminUsername: *string │ ├── EnableCSIProxy: *bool │ ├── GmsaProfile: *Object (3 properties) @@ -1114,8 +1113,7 @@ ManagedCluster_STATUS_ARM: Object (10 properties) │ │ │ └── Enabled: *bool │ │ └── SnapshotController: *Object (1 property) │ │ └── Enabled: *bool -│ ├── WindowsProfile: *Object (5 properties) -│ │ ├── AdminPassword: *string +│ ├── WindowsProfile: *Object (4 properties) │ │ ├── AdminUsername: *string │ │ ├── EnableCSIProxy: *bool │ │ ├── GmsaProfile: *Object (3 properties) diff --git a/v2/api/containerservice/v1api20230201/zz_generated.deepcopy.go b/v2/api/containerservice/v1api20230201/zz_generated.deepcopy.go index 51adc44df6b..b591a02aa19 100644 --- a/v2/api/containerservice/v1api20230201/zz_generated.deepcopy.go +++ b/v2/api/containerservice/v1api20230201/zz_generated.deepcopy.go @@ -7446,7 +7446,7 @@ func (in *ManagedClusterWindowsProfile) DeepCopyInto(out *ManagedClusterWindowsP *out = *in if in.AdminPassword != nil { in, out := &in.AdminPassword, &out.AdminPassword - *out = new(string) + *out = new(genruntime.SecretReference) **out = **in } if in.AdminUsername != nil { @@ -7524,11 +7524,6 @@ func (in *ManagedClusterWindowsProfile_ARM) DeepCopy() *ManagedClusterWindowsPro // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ManagedClusterWindowsProfile_STATUS) DeepCopyInto(out *ManagedClusterWindowsProfile_STATUS) { *out = *in - if in.AdminPassword != nil { - in, out := &in.AdminPassword, &out.AdminPassword - *out = new(string) - **out = **in - } if in.AdminUsername != nil { in, out := &in.AdminUsername, &out.AdminUsername *out = new(string) @@ -7564,11 +7559,6 @@ func (in *ManagedClusterWindowsProfile_STATUS) DeepCopy() *ManagedClusterWindows // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ManagedClusterWindowsProfile_STATUS_ARM) DeepCopyInto(out *ManagedClusterWindowsProfile_STATUS_ARM) { *out = *in - if in.AdminPassword != nil { - in, out := &in.AdminPassword, &out.AdminPassword - *out = new(string) - **out = **in - } if in.AdminUsername != nil { in, out := &in.AdminUsername, &out.AdminUsername *out = new(string) diff --git a/v2/api/containerservice/v1api20230202preview/managed_cluster_status_arm_types_gen.go b/v2/api/containerservice/v1api20230202preview/managed_cluster_status_arm_types_gen.go index 3b143ba93f9..ac97422ab96 100644 --- a/v2/api/containerservice/v1api20230202preview/managed_cluster_status_arm_types_gen.go +++ b/v2/api/containerservice/v1api20230202preview/managed_cluster_status_arm_types_gen.go @@ -834,18 +834,6 @@ type ManagedClusterStorageProfile_STATUS_ARM struct { // Profile for Windows VMs in the managed cluster. type ManagedClusterWindowsProfile_STATUS_ARM struct { - // AdminPassword: Specifies the password of the administrator account. - // Minimum-length: 8 characters - // Max-length: 123 characters - // Complexity requirements: 3 out of 4 conditions below need to be fulfilled - // Has lower characters - // Has upper characters - // Has a digit - // Has a special character (Regex match [\W_]) - // Disallowed values: "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", - // "Password22", "iloveyou!" - AdminPassword *string `json:"adminPassword,omitempty"` - // AdminUsername: Specifies the name of the administrator account. // Restriction: Cannot end in "." // Disallowed values: "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", diff --git a/v2/api/containerservice/v1api20230202preview/managed_cluster_status_arm_types_gen_test.go b/v2/api/containerservice/v1api20230202preview/managed_cluster_status_arm_types_gen_test.go index 287805f513e..bcffc5da0ad 100644 --- a/v2/api/containerservice/v1api20230202preview/managed_cluster_status_arm_types_gen_test.go +++ b/v2/api/containerservice/v1api20230202preview/managed_cluster_status_arm_types_gen_test.go @@ -4014,7 +4014,6 @@ func ManagedClusterWindowsProfile_STATUS_ARMGenerator() gopter.Gen { // AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile_STATUS_ARM is a factory method for creating gopter generators func AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile_STATUS_ARM(gens map[string]gopter.Gen) { - gens["AdminPassword"] = gen.PtrOf(gen.AlphaString()) gens["AdminUsername"] = gen.PtrOf(gen.AlphaString()) gens["EnableCSIProxy"] = gen.PtrOf(gen.Bool()) gens["LicenseType"] = gen.PtrOf(gen.OneConstOf(ManagedClusterWindowsProfile_LicenseType_STATUS_None, ManagedClusterWindowsProfile_LicenseType_STATUS_Windows_Server)) diff --git a/v2/api/containerservice/v1api20230202preview/managed_cluster_types_gen.go b/v2/api/containerservice/v1api20230202preview/managed_cluster_types_gen.go index db8963903b1..e52468a95dc 100644 --- a/v2/api/containerservice/v1api20230202preview/managed_cluster_types_gen.go +++ b/v2/api/containerservice/v1api20230202preview/managed_cluster_types_gen.go @@ -14122,7 +14122,7 @@ type ManagedClusterWindowsProfile struct { // Has a special character (Regex match [\W_]) // Disallowed values: "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", // "Password22", "iloveyou!" - AdminPassword *string `json:"adminPassword,omitempty"` + AdminPassword *genruntime.SecretReference `json:"adminPassword,omitempty"` // +kubebuilder:validation:Required // AdminUsername: Specifies the name of the administrator account. @@ -14157,7 +14157,11 @@ func (profile *ManagedClusterWindowsProfile) ConvertToARM(resolved genruntime.Co // Set property "AdminPassword": if profile.AdminPassword != nil { - adminPassword := *profile.AdminPassword + adminPasswordSecret, err := resolved.ResolvedSecrets.Lookup(*profile.AdminPassword) + if err != nil { + return nil, errors.Wrap(err, "looking up secret for property AdminPassword") + } + adminPassword := adminPasswordSecret result.AdminPassword = &adminPassword } @@ -14203,11 +14207,7 @@ func (profile *ManagedClusterWindowsProfile) PopulateFromARM(owner genruntime.Ar return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected ManagedClusterWindowsProfile_ARM, got %T", armInput) } - // Set property "AdminPassword": - if typedInput.AdminPassword != nil { - adminPassword := *typedInput.AdminPassword - profile.AdminPassword = &adminPassword - } + // no assignment for property "AdminPassword" // Set property "AdminUsername": if typedInput.AdminUsername != nil { @@ -14246,7 +14246,12 @@ func (profile *ManagedClusterWindowsProfile) PopulateFromARM(owner genruntime.Ar func (profile *ManagedClusterWindowsProfile) AssignProperties_From_ManagedClusterWindowsProfile(source *storage.ManagedClusterWindowsProfile) error { // AdminPassword - profile.AdminPassword = genruntime.ClonePointerToString(source.AdminPassword) + if source.AdminPassword != nil { + adminPassword := source.AdminPassword.Copy() + profile.AdminPassword = &adminPassword + } else { + profile.AdminPassword = nil + } // AdminUsername profile.AdminUsername = genruntime.ClonePointerToString(source.AdminUsername) @@ -14290,7 +14295,12 @@ func (profile *ManagedClusterWindowsProfile) AssignProperties_To_ManagedClusterW propertyBag := genruntime.NewPropertyBag() // AdminPassword - destination.AdminPassword = genruntime.ClonePointerToString(profile.AdminPassword) + if profile.AdminPassword != nil { + adminPassword := profile.AdminPassword.Copy() + destination.AdminPassword = &adminPassword + } else { + destination.AdminPassword = nil + } // AdminUsername destination.AdminUsername = genruntime.ClonePointerToString(profile.AdminUsername) @@ -14336,18 +14346,6 @@ func (profile *ManagedClusterWindowsProfile) AssignProperties_To_ManagedClusterW // Profile for Windows VMs in the managed cluster. type ManagedClusterWindowsProfile_STATUS struct { - // AdminPassword: Specifies the password of the administrator account. - // Minimum-length: 8 characters - // Max-length: 123 characters - // Complexity requirements: 3 out of 4 conditions below need to be fulfilled - // Has lower characters - // Has upper characters - // Has a digit - // Has a special character (Regex match [\W_]) - // Disallowed values: "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", - // "Password22", "iloveyou!" - AdminPassword *string `json:"adminPassword,omitempty"` - // AdminUsername: Specifies the name of the administrator account. // Restriction: Cannot end in "." // Disallowed values: "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", @@ -14383,12 +14381,6 @@ func (profile *ManagedClusterWindowsProfile_STATUS) PopulateFromARM(owner genrun return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected ManagedClusterWindowsProfile_STATUS_ARM, got %T", armInput) } - // Set property "AdminPassword": - if typedInput.AdminPassword != nil { - adminPassword := *typedInput.AdminPassword - profile.AdminPassword = &adminPassword - } - // Set property "AdminUsername": if typedInput.AdminUsername != nil { adminUsername := *typedInput.AdminUsername @@ -14425,9 +14417,6 @@ func (profile *ManagedClusterWindowsProfile_STATUS) PopulateFromARM(owner genrun // AssignProperties_From_ManagedClusterWindowsProfile_STATUS populates our ManagedClusterWindowsProfile_STATUS from the provided source ManagedClusterWindowsProfile_STATUS func (profile *ManagedClusterWindowsProfile_STATUS) AssignProperties_From_ManagedClusterWindowsProfile_STATUS(source *storage.ManagedClusterWindowsProfile_STATUS) error { - // AdminPassword - profile.AdminPassword = genruntime.ClonePointerToString(source.AdminPassword) - // AdminUsername profile.AdminUsername = genruntime.ClonePointerToString(source.AdminUsername) @@ -14469,9 +14458,6 @@ func (profile *ManagedClusterWindowsProfile_STATUS) AssignProperties_To_ManagedC // Create a new property bag propertyBag := genruntime.NewPropertyBag() - // AdminPassword - destination.AdminPassword = genruntime.ClonePointerToString(profile.AdminPassword) - // AdminUsername destination.AdminUsername = genruntime.ClonePointerToString(profile.AdminUsername) diff --git a/v2/api/containerservice/v1api20230202preview/managed_cluster_types_gen_test.go b/v2/api/containerservice/v1api20230202preview/managed_cluster_types_gen_test.go index 457d9cb6ec9..19dc30591c5 100644 --- a/v2/api/containerservice/v1api20230202preview/managed_cluster_types_gen_test.go +++ b/v2/api/containerservice/v1api20230202preview/managed_cluster_types_gen_test.go @@ -12288,7 +12288,6 @@ func ManagedClusterWindowsProfileGenerator() gopter.Gen { // AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile is a factory method for creating gopter generators func AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile(gens map[string]gopter.Gen) { - gens["AdminPassword"] = gen.PtrOf(gen.AlphaString()) gens["AdminUsername"] = gen.PtrOf(gen.AlphaString()) gens["EnableCSIProxy"] = gen.PtrOf(gen.Bool()) gens["LicenseType"] = gen.PtrOf(gen.OneConstOf(ManagedClusterWindowsProfile_LicenseType_None, ManagedClusterWindowsProfile_LicenseType_Windows_Server)) @@ -12408,7 +12407,6 @@ func ManagedClusterWindowsProfile_STATUSGenerator() gopter.Gen { // AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile_STATUS is a factory method for creating gopter generators func AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile_STATUS(gens map[string]gopter.Gen) { - gens["AdminPassword"] = gen.PtrOf(gen.AlphaString()) gens["AdminUsername"] = gen.PtrOf(gen.AlphaString()) gens["EnableCSIProxy"] = gen.PtrOf(gen.Bool()) gens["LicenseType"] = gen.PtrOf(gen.OneConstOf(ManagedClusterWindowsProfile_LicenseType_STATUS_None, ManagedClusterWindowsProfile_LicenseType_STATUS_Windows_Server)) diff --git a/v2/api/containerservice/v1api20230202preview/storage/managed_cluster_types_gen.go b/v2/api/containerservice/v1api20230202preview/storage/managed_cluster_types_gen.go index f0bebc0f269..6f7370274e6 100644 --- a/v2/api/containerservice/v1api20230202preview/storage/managed_cluster_types_gen.go +++ b/v2/api/containerservice/v1api20230202preview/storage/managed_cluster_types_gen.go @@ -8198,12 +8198,12 @@ func (profile *ManagedClusterStorageProfile_STATUS) AssignProperties_To_ManagedC // Storage version of v1api20230202preview.ManagedClusterWindowsProfile // Profile for Windows VMs in the managed cluster. type ManagedClusterWindowsProfile struct { - AdminPassword *string `json:"adminPassword,omitempty"` - AdminUsername *string `json:"adminUsername,omitempty"` - EnableCSIProxy *bool `json:"enableCSIProxy,omitempty"` - GmsaProfile *WindowsGmsaProfile `json:"gmsaProfile,omitempty"` - LicenseType *string `json:"licenseType,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + AdminPassword *genruntime.SecretReference `json:"adminPassword,omitempty"` + AdminUsername *string `json:"adminUsername,omitempty"` + EnableCSIProxy *bool `json:"enableCSIProxy,omitempty"` + GmsaProfile *WindowsGmsaProfile `json:"gmsaProfile,omitempty"` + LicenseType *string `json:"licenseType,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` } // AssignProperties_From_ManagedClusterWindowsProfile populates our ManagedClusterWindowsProfile from the provided source ManagedClusterWindowsProfile @@ -8212,7 +8212,12 @@ func (profile *ManagedClusterWindowsProfile) AssignProperties_From_ManagedCluste propertyBag := genruntime.NewPropertyBag(source.PropertyBag) // AdminPassword - profile.AdminPassword = genruntime.ClonePointerToString(source.AdminPassword) + if source.AdminPassword != nil { + adminPassword := source.AdminPassword.Copy() + profile.AdminPassword = &adminPassword + } else { + profile.AdminPassword = nil + } // AdminUsername profile.AdminUsername = genruntime.ClonePointerToString(source.AdminUsername) @@ -8266,7 +8271,12 @@ func (profile *ManagedClusterWindowsProfile) AssignProperties_To_ManagedClusterW propertyBag := genruntime.NewPropertyBag(profile.PropertyBag) // AdminPassword - destination.AdminPassword = genruntime.ClonePointerToString(profile.AdminPassword) + if profile.AdminPassword != nil { + adminPassword := profile.AdminPassword.Copy() + destination.AdminPassword = &adminPassword + } else { + destination.AdminPassword = nil + } // AdminUsername destination.AdminUsername = genruntime.ClonePointerToString(profile.AdminUsername) @@ -8317,7 +8327,6 @@ func (profile *ManagedClusterWindowsProfile) AssignProperties_To_ManagedClusterW // Storage version of v1api20230202preview.ManagedClusterWindowsProfile_STATUS // Profile for Windows VMs in the managed cluster. type ManagedClusterWindowsProfile_STATUS struct { - AdminPassword *string `json:"adminPassword,omitempty"` AdminUsername *string `json:"adminUsername,omitempty"` EnableCSIProxy *bool `json:"enableCSIProxy,omitempty"` GmsaProfile *WindowsGmsaProfile_STATUS `json:"gmsaProfile,omitempty"` @@ -8330,9 +8339,6 @@ func (profile *ManagedClusterWindowsProfile_STATUS) AssignProperties_From_Manage // Clone the existing property bag propertyBag := genruntime.NewPropertyBag(source.PropertyBag) - // AdminPassword - profile.AdminPassword = genruntime.ClonePointerToString(source.AdminPassword) - // AdminUsername profile.AdminUsername = genruntime.ClonePointerToString(source.AdminUsername) @@ -8384,9 +8390,6 @@ func (profile *ManagedClusterWindowsProfile_STATUS) AssignProperties_To_ManagedC // Clone the existing property bag propertyBag := genruntime.NewPropertyBag(profile.PropertyBag) - // AdminPassword - destination.AdminPassword = genruntime.ClonePointerToString(profile.AdminPassword) - // AdminUsername destination.AdminUsername = genruntime.ClonePointerToString(profile.AdminUsername) diff --git a/v2/api/containerservice/v1api20230202preview/storage/managed_cluster_types_gen_test.go b/v2/api/containerservice/v1api20230202preview/storage/managed_cluster_types_gen_test.go index bcf51042767..4e54cd56aa7 100644 --- a/v2/api/containerservice/v1api20230202preview/storage/managed_cluster_types_gen_test.go +++ b/v2/api/containerservice/v1api20230202preview/storage/managed_cluster_types_gen_test.go @@ -11637,7 +11637,6 @@ func ManagedClusterWindowsProfileGenerator() gopter.Gen { // AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile is a factory method for creating gopter generators func AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile(gens map[string]gopter.Gen) { - gens["AdminPassword"] = gen.PtrOf(gen.AlphaString()) gens["AdminUsername"] = gen.PtrOf(gen.AlphaString()) gens["EnableCSIProxy"] = gen.PtrOf(gen.Bool()) gens["LicenseType"] = gen.PtrOf(gen.AlphaString()) @@ -11757,7 +11756,6 @@ func ManagedClusterWindowsProfile_STATUSGenerator() gopter.Gen { // AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile_STATUS is a factory method for creating gopter generators func AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile_STATUS(gens map[string]gopter.Gen) { - gens["AdminPassword"] = gen.PtrOf(gen.AlphaString()) gens["AdminUsername"] = gen.PtrOf(gen.AlphaString()) gens["EnableCSIProxy"] = gen.PtrOf(gen.Bool()) gens["LicenseType"] = gen.PtrOf(gen.AlphaString()) diff --git a/v2/api/containerservice/v1api20230202preview/storage/structure.txt b/v2/api/containerservice/v1api20230202preview/storage/structure.txt index 1069c40bf1b..a1edda14fd0 100644 --- a/v2/api/containerservice/v1api20230202preview/storage/structure.txt +++ b/v2/api/containerservice/v1api20230202preview/storage/structure.txt @@ -396,7 +396,7 @@ ManagedCluster: Resource │ │ │ └── Until: *string │ │ └── PropertyBag: genruntime.PropertyBag │ ├── WindowsProfile: *Object (6 properties) -│ │ ├── AdminPassword: *string +│ │ ├── AdminPassword: *genruntime.SecretReference │ │ ├── AdminUsername: *string │ │ ├── EnableCSIProxy: *bool │ │ ├── GmsaProfile: *Object (4 properties) @@ -848,8 +848,7 @@ ManagedCluster: Resource │ │ ├── PropertyBag: genruntime.PropertyBag │ │ └── Until: *string │ └── PropertyBag: genruntime.PropertyBag - ├── WindowsProfile: *Object (6 properties) - │ ├── AdminPassword: *string + ├── WindowsProfile: *Object (5 properties) │ ├── AdminUsername: *string │ ├── EnableCSIProxy: *bool │ ├── GmsaProfile: *Object (4 properties) diff --git a/v2/api/containerservice/v1api20230202preview/storage/zz_generated.deepcopy.go b/v2/api/containerservice/v1api20230202preview/storage/zz_generated.deepcopy.go index 03cd7b821f7..9c3b08d25d1 100644 --- a/v2/api/containerservice/v1api20230202preview/storage/zz_generated.deepcopy.go +++ b/v2/api/containerservice/v1api20230202preview/storage/zz_generated.deepcopy.go @@ -5095,7 +5095,7 @@ func (in *ManagedClusterWindowsProfile) DeepCopyInto(out *ManagedClusterWindowsP *out = *in if in.AdminPassword != nil { in, out := &in.AdminPassword, &out.AdminPassword - *out = new(string) + *out = new(genruntime.SecretReference) **out = **in } if in.AdminUsername != nil { @@ -5140,11 +5140,6 @@ func (in *ManagedClusterWindowsProfile) DeepCopy() *ManagedClusterWindowsProfile // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ManagedClusterWindowsProfile_STATUS) DeepCopyInto(out *ManagedClusterWindowsProfile_STATUS) { *out = *in - if in.AdminPassword != nil { - in, out := &in.AdminPassword, &out.AdminPassword - *out = new(string) - **out = **in - } if in.AdminUsername != nil { in, out := &in.AdminUsername, &out.AdminUsername *out = new(string) diff --git a/v2/api/containerservice/v1api20230202preview/structure.txt b/v2/api/containerservice/v1api20230202preview/structure.txt index 44d99dfd09e..37094f2b2ad 100644 --- a/v2/api/containerservice/v1api20230202preview/structure.txt +++ b/v2/api/containerservice/v1api20230202preview/structure.txt @@ -443,7 +443,7 @@ ManagedCluster: Resource │ │ │ └── "IgnoreKubernetesDeprecations" │ │ └── Until: *string │ ├── WindowsProfile: *Object (5 properties) -│ │ ├── AdminPassword: *string +│ │ ├── AdminPassword: *genruntime.SecretReference │ │ ├── AdminUsername: *string │ │ ├── EnableCSIProxy: *bool │ │ ├── GmsaProfile: *Object (3 properties) @@ -927,8 +927,7 @@ ManagedCluster: Resource │ ├── ControlPlaneOverrides: Enum (1 value)[] │ │ └── "IgnoreKubernetesDeprecations" │ └── Until: *string - ├── WindowsProfile: *Object (5 properties) - │ ├── AdminPassword: *string + ├── WindowsProfile: *Object (4 properties) │ ├── AdminUsername: *string │ ├── EnableCSIProxy: *bool │ ├── GmsaProfile: *Object (3 properties) @@ -1389,8 +1388,7 @@ ManagedCluster_STATUS_ARM: Object (10 properties) │ │ ├── ControlPlaneOverrides: Enum (1 value)[] │ │ │ └── "IgnoreKubernetesDeprecations" │ │ └── Until: *string -│ ├── WindowsProfile: *Object (5 properties) -│ │ ├── AdminPassword: *string +│ ├── WindowsProfile: *Object (4 properties) │ │ ├── AdminUsername: *string │ │ ├── EnableCSIProxy: *bool │ │ ├── GmsaProfile: *Object (3 properties) diff --git a/v2/api/containerservice/v1api20230202preview/zz_generated.deepcopy.go b/v2/api/containerservice/v1api20230202preview/zz_generated.deepcopy.go index 069984f36d0..85ec8ca33d9 100644 --- a/v2/api/containerservice/v1api20230202preview/zz_generated.deepcopy.go +++ b/v2/api/containerservice/v1api20230202preview/zz_generated.deepcopy.go @@ -9259,7 +9259,7 @@ func (in *ManagedClusterWindowsProfile) DeepCopyInto(out *ManagedClusterWindowsP *out = *in if in.AdminPassword != nil { in, out := &in.AdminPassword, &out.AdminPassword - *out = new(string) + *out = new(genruntime.SecretReference) **out = **in } if in.AdminUsername != nil { @@ -9337,11 +9337,6 @@ func (in *ManagedClusterWindowsProfile_ARM) DeepCopy() *ManagedClusterWindowsPro // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ManagedClusterWindowsProfile_STATUS) DeepCopyInto(out *ManagedClusterWindowsProfile_STATUS) { *out = *in - if in.AdminPassword != nil { - in, out := &in.AdminPassword, &out.AdminPassword - *out = new(string) - **out = **in - } if in.AdminUsername != nil { in, out := &in.AdminUsername, &out.AdminUsername *out = new(string) @@ -9377,11 +9372,6 @@ func (in *ManagedClusterWindowsProfile_STATUS) DeepCopy() *ManagedClusterWindows // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ManagedClusterWindowsProfile_STATUS_ARM) DeepCopyInto(out *ManagedClusterWindowsProfile_STATUS_ARM) { *out = *in - if in.AdminPassword != nil { - in, out := &in.AdminPassword, &out.AdminPassword - *out = new(string) - **out = **in - } if in.AdminUsername != nil { in, out := &in.AdminUsername, &out.AdminUsername *out = new(string) diff --git a/v2/api/containerservice/v1api20231001/managed_cluster_status_arm_types_gen.go b/v2/api/containerservice/v1api20231001/managed_cluster_status_arm_types_gen.go index fcae0be1e9a..f4b7111e030 100644 --- a/v2/api/containerservice/v1api20231001/managed_cluster_status_arm_types_gen.go +++ b/v2/api/containerservice/v1api20231001/managed_cluster_status_arm_types_gen.go @@ -774,18 +774,6 @@ type ManagedClusterStorageProfile_STATUS_ARM struct { // Profile for Windows VMs in the managed cluster. type ManagedClusterWindowsProfile_STATUS_ARM struct { - // AdminPassword: Specifies the password of the administrator account. - // Minimum-length: 8 characters - // Max-length: 123 characters - // Complexity requirements: 3 out of 4 conditions below need to be fulfilled - // Has lower characters - // Has upper characters - // Has a digit - // Has a special character (Regex match [\W_]) - // Disallowed values: "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", - // "Password22", "iloveyou!" - AdminPassword *string `json:"adminPassword,omitempty"` - // AdminUsername: Specifies the name of the administrator account. // Restriction: Cannot end in "." // Disallowed values: "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", diff --git a/v2/api/containerservice/v1api20231001/managed_cluster_status_arm_types_gen_test.go b/v2/api/containerservice/v1api20231001/managed_cluster_status_arm_types_gen_test.go index 46f4e1eb088..2227379bd20 100644 --- a/v2/api/containerservice/v1api20231001/managed_cluster_status_arm_types_gen_test.go +++ b/v2/api/containerservice/v1api20231001/managed_cluster_status_arm_types_gen_test.go @@ -3732,7 +3732,6 @@ func ManagedClusterWindowsProfile_STATUS_ARMGenerator() gopter.Gen { // AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile_STATUS_ARM is a factory method for creating gopter generators func AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile_STATUS_ARM(gens map[string]gopter.Gen) { - gens["AdminPassword"] = gen.PtrOf(gen.AlphaString()) gens["AdminUsername"] = gen.PtrOf(gen.AlphaString()) gens["EnableCSIProxy"] = gen.PtrOf(gen.Bool()) gens["LicenseType"] = gen.PtrOf(gen.OneConstOf(ManagedClusterWindowsProfile_LicenseType_STATUS_None, ManagedClusterWindowsProfile_LicenseType_STATUS_Windows_Server)) diff --git a/v2/api/containerservice/v1api20231001/managed_cluster_types_gen.go b/v2/api/containerservice/v1api20231001/managed_cluster_types_gen.go index cdfd47df688..efdf1b99f24 100644 --- a/v2/api/containerservice/v1api20231001/managed_cluster_types_gen.go +++ b/v2/api/containerservice/v1api20231001/managed_cluster_types_gen.go @@ -13967,7 +13967,7 @@ type ManagedClusterWindowsProfile struct { // Has a special character (Regex match [\W_]) // Disallowed values: "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", // "Password22", "iloveyou!" - AdminPassword *string `json:"adminPassword,omitempty"` + AdminPassword *genruntime.SecretReference `json:"adminPassword,omitempty"` // +kubebuilder:validation:Required // AdminUsername: Specifies the name of the administrator account. @@ -14002,7 +14002,11 @@ func (profile *ManagedClusterWindowsProfile) ConvertToARM(resolved genruntime.Co // Set property "AdminPassword": if profile.AdminPassword != nil { - adminPassword := *profile.AdminPassword + adminPasswordSecret, err := resolved.ResolvedSecrets.Lookup(*profile.AdminPassword) + if err != nil { + return nil, errors.Wrap(err, "looking up secret for property AdminPassword") + } + adminPassword := adminPasswordSecret result.AdminPassword = &adminPassword } @@ -14048,11 +14052,7 @@ func (profile *ManagedClusterWindowsProfile) PopulateFromARM(owner genruntime.Ar return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected ManagedClusterWindowsProfile_ARM, got %T", armInput) } - // Set property "AdminPassword": - if typedInput.AdminPassword != nil { - adminPassword := *typedInput.AdminPassword - profile.AdminPassword = &adminPassword - } + // no assignment for property "AdminPassword" // Set property "AdminUsername": if typedInput.AdminUsername != nil { @@ -14091,7 +14091,12 @@ func (profile *ManagedClusterWindowsProfile) PopulateFromARM(owner genruntime.Ar func (profile *ManagedClusterWindowsProfile) AssignProperties_From_ManagedClusterWindowsProfile(source *storage.ManagedClusterWindowsProfile) error { // AdminPassword - profile.AdminPassword = genruntime.ClonePointerToString(source.AdminPassword) + if source.AdminPassword != nil { + adminPassword := source.AdminPassword.Copy() + profile.AdminPassword = &adminPassword + } else { + profile.AdminPassword = nil + } // AdminUsername profile.AdminUsername = genruntime.ClonePointerToString(source.AdminUsername) @@ -14135,7 +14140,12 @@ func (profile *ManagedClusterWindowsProfile) AssignProperties_To_ManagedClusterW propertyBag := genruntime.NewPropertyBag() // AdminPassword - destination.AdminPassword = genruntime.ClonePointerToString(profile.AdminPassword) + if profile.AdminPassword != nil { + adminPassword := profile.AdminPassword.Copy() + destination.AdminPassword = &adminPassword + } else { + destination.AdminPassword = nil + } // AdminUsername destination.AdminUsername = genruntime.ClonePointerToString(profile.AdminUsername) @@ -14182,9 +14192,6 @@ func (profile *ManagedClusterWindowsProfile) AssignProperties_To_ManagedClusterW // Initialize_From_ManagedClusterWindowsProfile_STATUS populates our ManagedClusterWindowsProfile from the provided source ManagedClusterWindowsProfile_STATUS func (profile *ManagedClusterWindowsProfile) Initialize_From_ManagedClusterWindowsProfile_STATUS(source *ManagedClusterWindowsProfile_STATUS) error { - // AdminPassword - profile.AdminPassword = genruntime.ClonePointerToString(source.AdminPassword) - // AdminUsername profile.AdminUsername = genruntime.ClonePointerToString(source.AdminUsername) @@ -14222,18 +14229,6 @@ func (profile *ManagedClusterWindowsProfile) Initialize_From_ManagedClusterWindo // Profile for Windows VMs in the managed cluster. type ManagedClusterWindowsProfile_STATUS struct { - // AdminPassword: Specifies the password of the administrator account. - // Minimum-length: 8 characters - // Max-length: 123 characters - // Complexity requirements: 3 out of 4 conditions below need to be fulfilled - // Has lower characters - // Has upper characters - // Has a digit - // Has a special character (Regex match [\W_]) - // Disallowed values: "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", - // "Password22", "iloveyou!" - AdminPassword *string `json:"adminPassword,omitempty"` - // AdminUsername: Specifies the name of the administrator account. // Restriction: Cannot end in "." // Disallowed values: "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", @@ -14269,12 +14264,6 @@ func (profile *ManagedClusterWindowsProfile_STATUS) PopulateFromARM(owner genrun return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected ManagedClusterWindowsProfile_STATUS_ARM, got %T", armInput) } - // Set property "AdminPassword": - if typedInput.AdminPassword != nil { - adminPassword := *typedInput.AdminPassword - profile.AdminPassword = &adminPassword - } - // Set property "AdminUsername": if typedInput.AdminUsername != nil { adminUsername := *typedInput.AdminUsername @@ -14311,9 +14300,6 @@ func (profile *ManagedClusterWindowsProfile_STATUS) PopulateFromARM(owner genrun // AssignProperties_From_ManagedClusterWindowsProfile_STATUS populates our ManagedClusterWindowsProfile_STATUS from the provided source ManagedClusterWindowsProfile_STATUS func (profile *ManagedClusterWindowsProfile_STATUS) AssignProperties_From_ManagedClusterWindowsProfile_STATUS(source *storage.ManagedClusterWindowsProfile_STATUS) error { - // AdminPassword - profile.AdminPassword = genruntime.ClonePointerToString(source.AdminPassword) - // AdminUsername profile.AdminUsername = genruntime.ClonePointerToString(source.AdminUsername) @@ -14355,9 +14341,6 @@ func (profile *ManagedClusterWindowsProfile_STATUS) AssignProperties_To_ManagedC // Create a new property bag propertyBag := genruntime.NewPropertyBag() - // AdminPassword - destination.AdminPassword = genruntime.ClonePointerToString(profile.AdminPassword) - // AdminUsername destination.AdminUsername = genruntime.ClonePointerToString(profile.AdminUsername) diff --git a/v2/api/containerservice/v1api20231001/managed_cluster_types_gen_test.go b/v2/api/containerservice/v1api20231001/managed_cluster_types_gen_test.go index cc318943341..03ad2ca4b2b 100644 --- a/v2/api/containerservice/v1api20231001/managed_cluster_types_gen_test.go +++ b/v2/api/containerservice/v1api20231001/managed_cluster_types_gen_test.go @@ -11411,7 +11411,6 @@ func ManagedClusterWindowsProfileGenerator() gopter.Gen { // AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile is a factory method for creating gopter generators func AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile(gens map[string]gopter.Gen) { - gens["AdminPassword"] = gen.PtrOf(gen.AlphaString()) gens["AdminUsername"] = gen.PtrOf(gen.AlphaString()) gens["EnableCSIProxy"] = gen.PtrOf(gen.Bool()) gens["LicenseType"] = gen.PtrOf(gen.OneConstOf(ManagedClusterWindowsProfile_LicenseType_None, ManagedClusterWindowsProfile_LicenseType_Windows_Server)) @@ -11531,7 +11530,6 @@ func ManagedClusterWindowsProfile_STATUSGenerator() gopter.Gen { // AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile_STATUS is a factory method for creating gopter generators func AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile_STATUS(gens map[string]gopter.Gen) { - gens["AdminPassword"] = gen.PtrOf(gen.AlphaString()) gens["AdminUsername"] = gen.PtrOf(gen.AlphaString()) gens["EnableCSIProxy"] = gen.PtrOf(gen.Bool()) gens["LicenseType"] = gen.PtrOf(gen.OneConstOf(ManagedClusterWindowsProfile_LicenseType_STATUS_None, ManagedClusterWindowsProfile_LicenseType_STATUS_Windows_Server)) diff --git a/v2/api/containerservice/v1api20231001/storage/managed_cluster_types_gen.go b/v2/api/containerservice/v1api20231001/storage/managed_cluster_types_gen.go index 51d80514a86..9348478aa46 100644 --- a/v2/api/containerservice/v1api20231001/storage/managed_cluster_types_gen.go +++ b/v2/api/containerservice/v1api20231001/storage/managed_cluster_types_gen.go @@ -828,18 +828,17 @@ type ManagedClusterStorageProfile_STATUS struct { // Storage version of v1api20231001.ManagedClusterWindowsProfile // Profile for Windows VMs in the managed cluster. type ManagedClusterWindowsProfile struct { - AdminPassword *string `json:"adminPassword,omitempty"` - AdminUsername *string `json:"adminUsername,omitempty"` - EnableCSIProxy *bool `json:"enableCSIProxy,omitempty"` - GmsaProfile *WindowsGmsaProfile `json:"gmsaProfile,omitempty"` - LicenseType *string `json:"licenseType,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + AdminPassword *genruntime.SecretReference `json:"adminPassword,omitempty"` + AdminUsername *string `json:"adminUsername,omitempty"` + EnableCSIProxy *bool `json:"enableCSIProxy,omitempty"` + GmsaProfile *WindowsGmsaProfile `json:"gmsaProfile,omitempty"` + LicenseType *string `json:"licenseType,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` } // Storage version of v1api20231001.ManagedClusterWindowsProfile_STATUS // Profile for Windows VMs in the managed cluster. type ManagedClusterWindowsProfile_STATUS struct { - AdminPassword *string `json:"adminPassword,omitempty"` AdminUsername *string `json:"adminUsername,omitempty"` EnableCSIProxy *bool `json:"enableCSIProxy,omitempty"` GmsaProfile *WindowsGmsaProfile_STATUS `json:"gmsaProfile,omitempty"` diff --git a/v2/api/containerservice/v1api20231001/storage/managed_cluster_types_gen_test.go b/v2/api/containerservice/v1api20231001/storage/managed_cluster_types_gen_test.go index cd17c6e9e95..bf4e2313faf 100644 --- a/v2/api/containerservice/v1api20231001/storage/managed_cluster_types_gen_test.go +++ b/v2/api/containerservice/v1api20231001/storage/managed_cluster_types_gen_test.go @@ -6945,7 +6945,6 @@ func ManagedClusterWindowsProfileGenerator() gopter.Gen { // AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile is a factory method for creating gopter generators func AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile(gens map[string]gopter.Gen) { - gens["AdminPassword"] = gen.PtrOf(gen.AlphaString()) gens["AdminUsername"] = gen.PtrOf(gen.AlphaString()) gens["EnableCSIProxy"] = gen.PtrOf(gen.Bool()) gens["LicenseType"] = gen.PtrOf(gen.AlphaString()) @@ -7023,7 +7022,6 @@ func ManagedClusterWindowsProfile_STATUSGenerator() gopter.Gen { // AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile_STATUS is a factory method for creating gopter generators func AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile_STATUS(gens map[string]gopter.Gen) { - gens["AdminPassword"] = gen.PtrOf(gen.AlphaString()) gens["AdminUsername"] = gen.PtrOf(gen.AlphaString()) gens["EnableCSIProxy"] = gen.PtrOf(gen.Bool()) gens["LicenseType"] = gen.PtrOf(gen.AlphaString()) diff --git a/v2/api/containerservice/v1api20231001/storage/structure.txt b/v2/api/containerservice/v1api20231001/storage/structure.txt index b052c701a9e..b6e937e515c 100644 --- a/v2/api/containerservice/v1api20231001/storage/structure.txt +++ b/v2/api/containerservice/v1api20231001/storage/structure.txt @@ -377,7 +377,7 @@ ManagedCluster: Resource │ │ │ └── Until: *string │ │ └── PropertyBag: genruntime.PropertyBag │ ├── WindowsProfile: *Object (6 properties) -│ │ ├── AdminPassword: *string +│ │ ├── AdminPassword: *genruntime.SecretReference │ │ ├── AdminUsername: *string │ │ ├── EnableCSIProxy: *bool │ │ ├── GmsaProfile: *Object (4 properties) @@ -802,8 +802,7 @@ ManagedCluster: Resource │ │ ├── PropertyBag: genruntime.PropertyBag │ │ └── Until: *string │ └── PropertyBag: genruntime.PropertyBag - ├── WindowsProfile: *Object (6 properties) - │ ├── AdminPassword: *string + ├── WindowsProfile: *Object (5 properties) │ ├── AdminUsername: *string │ ├── EnableCSIProxy: *bool │ ├── GmsaProfile: *Object (4 properties) diff --git a/v2/api/containerservice/v1api20231001/storage/zz_generated.deepcopy.go b/v2/api/containerservice/v1api20231001/storage/zz_generated.deepcopy.go index 8a6f0ccec60..77b30ece1a6 100644 --- a/v2/api/containerservice/v1api20231001/storage/zz_generated.deepcopy.go +++ b/v2/api/containerservice/v1api20231001/storage/zz_generated.deepcopy.go @@ -4826,7 +4826,7 @@ func (in *ManagedClusterWindowsProfile) DeepCopyInto(out *ManagedClusterWindowsP *out = *in if in.AdminPassword != nil { in, out := &in.AdminPassword, &out.AdminPassword - *out = new(string) + *out = new(genruntime.SecretReference) **out = **in } if in.AdminUsername != nil { @@ -4871,11 +4871,6 @@ func (in *ManagedClusterWindowsProfile) DeepCopy() *ManagedClusterWindowsProfile // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ManagedClusterWindowsProfile_STATUS) DeepCopyInto(out *ManagedClusterWindowsProfile_STATUS) { *out = *in - if in.AdminPassword != nil { - in, out := &in.AdminPassword, &out.AdminPassword - *out = new(string) - **out = **in - } if in.AdminUsername != nil { in, out := &in.AdminUsername, &out.AdminUsername *out = new(string) diff --git a/v2/api/containerservice/v1api20231001/structure.txt b/v2/api/containerservice/v1api20231001/structure.txt index 08fd4321bdb..5bb0592ed46 100644 --- a/v2/api/containerservice/v1api20231001/structure.txt +++ b/v2/api/containerservice/v1api20231001/structure.txt @@ -426,7 +426,7 @@ ManagedCluster: Resource │ │ ├── ForceUpgrade: *bool │ │ └── Until: *string │ ├── WindowsProfile: *Object (5 properties) -│ │ ├── AdminPassword: *string +│ │ ├── AdminPassword: *genruntime.SecretReference │ │ ├── AdminUsername: *string │ │ ├── EnableCSIProxy: *bool │ │ ├── GmsaProfile: *Object (3 properties) @@ -873,8 +873,7 @@ ManagedCluster: Resource │ └── OverrideSettings: *Object (2 properties) │ ├── ForceUpgrade: *bool │ └── Until: *string - ├── WindowsProfile: *Object (5 properties) - │ ├── AdminPassword: *string + ├── WindowsProfile: *Object (4 properties) │ ├── AdminUsername: *string │ ├── EnableCSIProxy: *bool │ ├── GmsaProfile: *Object (3 properties) @@ -1297,8 +1296,7 @@ ManagedCluster_STATUS_ARM: Object (10 properties) │ │ └── OverrideSettings: *Object (2 properties) │ │ ├── ForceUpgrade: *bool │ │ └── Until: *string -│ ├── WindowsProfile: *Object (5 properties) -│ │ ├── AdminPassword: *string +│ ├── WindowsProfile: *Object (4 properties) │ │ ├── AdminUsername: *string │ │ ├── EnableCSIProxy: *bool │ │ ├── GmsaProfile: *Object (3 properties) diff --git a/v2/api/containerservice/v1api20231001/zz_generated.deepcopy.go b/v2/api/containerservice/v1api20231001/zz_generated.deepcopy.go index 7618a1b2244..f358e1b10b0 100644 --- a/v2/api/containerservice/v1api20231001/zz_generated.deepcopy.go +++ b/v2/api/containerservice/v1api20231001/zz_generated.deepcopy.go @@ -8749,7 +8749,7 @@ func (in *ManagedClusterWindowsProfile) DeepCopyInto(out *ManagedClusterWindowsP *out = *in if in.AdminPassword != nil { in, out := &in.AdminPassword, &out.AdminPassword - *out = new(string) + *out = new(genruntime.SecretReference) **out = **in } if in.AdminUsername != nil { @@ -8827,11 +8827,6 @@ func (in *ManagedClusterWindowsProfile_ARM) DeepCopy() *ManagedClusterWindowsPro // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ManagedClusterWindowsProfile_STATUS) DeepCopyInto(out *ManagedClusterWindowsProfile_STATUS) { *out = *in - if in.AdminPassword != nil { - in, out := &in.AdminPassword, &out.AdminPassword - *out = new(string) - **out = **in - } if in.AdminUsername != nil { in, out := &in.AdminUsername, &out.AdminUsername *out = new(string) @@ -8867,11 +8862,6 @@ func (in *ManagedClusterWindowsProfile_STATUS) DeepCopy() *ManagedClusterWindows // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ManagedClusterWindowsProfile_STATUS_ARM) DeepCopyInto(out *ManagedClusterWindowsProfile_STATUS_ARM) { *out = *in - if in.AdminPassword != nil { - in, out := &in.AdminPassword, &out.AdminPassword - *out = new(string) - **out = **in - } if in.AdminUsername != nil { in, out := &in.AdminUsername, &out.AdminUsername *out = new(string) diff --git a/v2/api/containerservice/v1api20231102preview/managed_cluster_status_arm_types_gen.go b/v2/api/containerservice/v1api20231102preview/managed_cluster_status_arm_types_gen.go index e882349c946..4a7efce718f 100644 --- a/v2/api/containerservice/v1api20231102preview/managed_cluster_status_arm_types_gen.go +++ b/v2/api/containerservice/v1api20231102preview/managed_cluster_status_arm_types_gen.go @@ -915,18 +915,6 @@ type ManagedClusterStorageProfile_STATUS_ARM struct { // Profile for Windows VMs in the managed cluster. type ManagedClusterWindowsProfile_STATUS_ARM struct { - // AdminPassword: Specifies the password of the administrator account. - // Minimum-length: 8 characters - // Max-length: 123 characters - // Complexity requirements: 3 out of 4 conditions below need to be fulfilled - // Has lower characters - // Has upper characters - // Has a digit - // Has a special character (Regex match [\W_]) - // Disallowed values: "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", - // "Password22", "iloveyou!" - AdminPassword *string `json:"adminPassword,omitempty"` - // AdminUsername: Specifies the name of the administrator account. // Restriction: Cannot end in "." // Disallowed values: "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", diff --git a/v2/api/containerservice/v1api20231102preview/managed_cluster_status_arm_types_gen_test.go b/v2/api/containerservice/v1api20231102preview/managed_cluster_status_arm_types_gen_test.go index 41a149d8173..56fbfb338bd 100644 --- a/v2/api/containerservice/v1api20231102preview/managed_cluster_status_arm_types_gen_test.go +++ b/v2/api/containerservice/v1api20231102preview/managed_cluster_status_arm_types_gen_test.go @@ -4802,7 +4802,6 @@ func ManagedClusterWindowsProfile_STATUS_ARMGenerator() gopter.Gen { // AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile_STATUS_ARM is a factory method for creating gopter generators func AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile_STATUS_ARM(gens map[string]gopter.Gen) { - gens["AdminPassword"] = gen.PtrOf(gen.AlphaString()) gens["AdminUsername"] = gen.PtrOf(gen.AlphaString()) gens["EnableCSIProxy"] = gen.PtrOf(gen.Bool()) gens["LicenseType"] = gen.PtrOf(gen.OneConstOf(ManagedClusterWindowsProfile_LicenseType_STATUS_None, ManagedClusterWindowsProfile_LicenseType_STATUS_Windows_Server)) diff --git a/v2/api/containerservice/v1api20231102preview/managed_cluster_types_gen.go b/v2/api/containerservice/v1api20231102preview/managed_cluster_types_gen.go index df3c7cf7863..3802c75c078 100644 --- a/v2/api/containerservice/v1api20231102preview/managed_cluster_types_gen.go +++ b/v2/api/containerservice/v1api20231102preview/managed_cluster_types_gen.go @@ -15756,7 +15756,7 @@ type ManagedClusterWindowsProfile struct { // Has a special character (Regex match [\W_]) // Disallowed values: "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", // "Password22", "iloveyou!" - AdminPassword *string `json:"adminPassword,omitempty"` + AdminPassword *genruntime.SecretReference `json:"adminPassword,omitempty"` // +kubebuilder:validation:Required // AdminUsername: Specifies the name of the administrator account. @@ -15791,7 +15791,11 @@ func (profile *ManagedClusterWindowsProfile) ConvertToARM(resolved genruntime.Co // Set property "AdminPassword": if profile.AdminPassword != nil { - adminPassword := *profile.AdminPassword + adminPasswordSecret, err := resolved.ResolvedSecrets.Lookup(*profile.AdminPassword) + if err != nil { + return nil, errors.Wrap(err, "looking up secret for property AdminPassword") + } + adminPassword := adminPasswordSecret result.AdminPassword = &adminPassword } @@ -15837,11 +15841,7 @@ func (profile *ManagedClusterWindowsProfile) PopulateFromARM(owner genruntime.Ar return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected ManagedClusterWindowsProfile_ARM, got %T", armInput) } - // Set property "AdminPassword": - if typedInput.AdminPassword != nil { - adminPassword := *typedInput.AdminPassword - profile.AdminPassword = &adminPassword - } + // no assignment for property "AdminPassword" // Set property "AdminUsername": if typedInput.AdminUsername != nil { @@ -15880,7 +15880,12 @@ func (profile *ManagedClusterWindowsProfile) PopulateFromARM(owner genruntime.Ar func (profile *ManagedClusterWindowsProfile) AssignProperties_From_ManagedClusterWindowsProfile(source *storage.ManagedClusterWindowsProfile) error { // AdminPassword - profile.AdminPassword = genruntime.ClonePointerToString(source.AdminPassword) + if source.AdminPassword != nil { + adminPassword := source.AdminPassword.Copy() + profile.AdminPassword = &adminPassword + } else { + profile.AdminPassword = nil + } // AdminUsername profile.AdminUsername = genruntime.ClonePointerToString(source.AdminUsername) @@ -15924,7 +15929,12 @@ func (profile *ManagedClusterWindowsProfile) AssignProperties_To_ManagedClusterW propertyBag := genruntime.NewPropertyBag() // AdminPassword - destination.AdminPassword = genruntime.ClonePointerToString(profile.AdminPassword) + if profile.AdminPassword != nil { + adminPassword := profile.AdminPassword.Copy() + destination.AdminPassword = &adminPassword + } else { + destination.AdminPassword = nil + } // AdminUsername destination.AdminUsername = genruntime.ClonePointerToString(profile.AdminUsername) @@ -15970,18 +15980,6 @@ func (profile *ManagedClusterWindowsProfile) AssignProperties_To_ManagedClusterW // Profile for Windows VMs in the managed cluster. type ManagedClusterWindowsProfile_STATUS struct { - // AdminPassword: Specifies the password of the administrator account. - // Minimum-length: 8 characters - // Max-length: 123 characters - // Complexity requirements: 3 out of 4 conditions below need to be fulfilled - // Has lower characters - // Has upper characters - // Has a digit - // Has a special character (Regex match [\W_]) - // Disallowed values: "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", - // "Password22", "iloveyou!" - AdminPassword *string `json:"adminPassword,omitempty"` - // AdminUsername: Specifies the name of the administrator account. // Restriction: Cannot end in "." // Disallowed values: "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", @@ -16017,12 +16015,6 @@ func (profile *ManagedClusterWindowsProfile_STATUS) PopulateFromARM(owner genrun return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected ManagedClusterWindowsProfile_STATUS_ARM, got %T", armInput) } - // Set property "AdminPassword": - if typedInput.AdminPassword != nil { - adminPassword := *typedInput.AdminPassword - profile.AdminPassword = &adminPassword - } - // Set property "AdminUsername": if typedInput.AdminUsername != nil { adminUsername := *typedInput.AdminUsername @@ -16059,9 +16051,6 @@ func (profile *ManagedClusterWindowsProfile_STATUS) PopulateFromARM(owner genrun // AssignProperties_From_ManagedClusterWindowsProfile_STATUS populates our ManagedClusterWindowsProfile_STATUS from the provided source ManagedClusterWindowsProfile_STATUS func (profile *ManagedClusterWindowsProfile_STATUS) AssignProperties_From_ManagedClusterWindowsProfile_STATUS(source *storage.ManagedClusterWindowsProfile_STATUS) error { - // AdminPassword - profile.AdminPassword = genruntime.ClonePointerToString(source.AdminPassword) - // AdminUsername profile.AdminUsername = genruntime.ClonePointerToString(source.AdminUsername) @@ -16103,9 +16092,6 @@ func (profile *ManagedClusterWindowsProfile_STATUS) AssignProperties_To_ManagedC // Create a new property bag propertyBag := genruntime.NewPropertyBag() - // AdminPassword - destination.AdminPassword = genruntime.ClonePointerToString(profile.AdminPassword) - // AdminUsername destination.AdminUsername = genruntime.ClonePointerToString(profile.AdminUsername) diff --git a/v2/api/containerservice/v1api20231102preview/managed_cluster_types_gen_test.go b/v2/api/containerservice/v1api20231102preview/managed_cluster_types_gen_test.go index 777e96bf002..dfd0d9803cd 100644 --- a/v2/api/containerservice/v1api20231102preview/managed_cluster_types_gen_test.go +++ b/v2/api/containerservice/v1api20231102preview/managed_cluster_types_gen_test.go @@ -15012,7 +15012,6 @@ func ManagedClusterWindowsProfileGenerator() gopter.Gen { // AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile is a factory method for creating gopter generators func AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile(gens map[string]gopter.Gen) { - gens["AdminPassword"] = gen.PtrOf(gen.AlphaString()) gens["AdminUsername"] = gen.PtrOf(gen.AlphaString()) gens["EnableCSIProxy"] = gen.PtrOf(gen.Bool()) gens["LicenseType"] = gen.PtrOf(gen.OneConstOf(ManagedClusterWindowsProfile_LicenseType_None, ManagedClusterWindowsProfile_LicenseType_Windows_Server)) @@ -15132,7 +15131,6 @@ func ManagedClusterWindowsProfile_STATUSGenerator() gopter.Gen { // AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile_STATUS is a factory method for creating gopter generators func AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile_STATUS(gens map[string]gopter.Gen) { - gens["AdminPassword"] = gen.PtrOf(gen.AlphaString()) gens["AdminUsername"] = gen.PtrOf(gen.AlphaString()) gens["EnableCSIProxy"] = gen.PtrOf(gen.Bool()) gens["LicenseType"] = gen.PtrOf(gen.OneConstOf(ManagedClusterWindowsProfile_LicenseType_STATUS_None, ManagedClusterWindowsProfile_LicenseType_STATUS_Windows_Server)) diff --git a/v2/api/containerservice/v1api20231102preview/storage/managed_cluster_types_gen.go b/v2/api/containerservice/v1api20231102preview/storage/managed_cluster_types_gen.go index 3b47e5a6902..f84da6d6780 100644 --- a/v2/api/containerservice/v1api20231102preview/storage/managed_cluster_types_gen.go +++ b/v2/api/containerservice/v1api20231102preview/storage/managed_cluster_types_gen.go @@ -9155,12 +9155,12 @@ func (profile *ManagedClusterStorageProfile_STATUS) AssignProperties_To_ManagedC // Storage version of v1api20231102preview.ManagedClusterWindowsProfile // Profile for Windows VMs in the managed cluster. type ManagedClusterWindowsProfile struct { - AdminPassword *string `json:"adminPassword,omitempty"` - AdminUsername *string `json:"adminUsername,omitempty"` - EnableCSIProxy *bool `json:"enableCSIProxy,omitempty"` - GmsaProfile *WindowsGmsaProfile `json:"gmsaProfile,omitempty"` - LicenseType *string `json:"licenseType,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + AdminPassword *genruntime.SecretReference `json:"adminPassword,omitempty"` + AdminUsername *string `json:"adminUsername,omitempty"` + EnableCSIProxy *bool `json:"enableCSIProxy,omitempty"` + GmsaProfile *WindowsGmsaProfile `json:"gmsaProfile,omitempty"` + LicenseType *string `json:"licenseType,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` } // AssignProperties_From_ManagedClusterWindowsProfile populates our ManagedClusterWindowsProfile from the provided source ManagedClusterWindowsProfile @@ -9169,7 +9169,12 @@ func (profile *ManagedClusterWindowsProfile) AssignProperties_From_ManagedCluste propertyBag := genruntime.NewPropertyBag(source.PropertyBag) // AdminPassword - profile.AdminPassword = genruntime.ClonePointerToString(source.AdminPassword) + if source.AdminPassword != nil { + adminPassword := source.AdminPassword.Copy() + profile.AdminPassword = &adminPassword + } else { + profile.AdminPassword = nil + } // AdminUsername profile.AdminUsername = genruntime.ClonePointerToString(source.AdminUsername) @@ -9223,7 +9228,12 @@ func (profile *ManagedClusterWindowsProfile) AssignProperties_To_ManagedClusterW propertyBag := genruntime.NewPropertyBag(profile.PropertyBag) // AdminPassword - destination.AdminPassword = genruntime.ClonePointerToString(profile.AdminPassword) + if profile.AdminPassword != nil { + adminPassword := profile.AdminPassword.Copy() + destination.AdminPassword = &adminPassword + } else { + destination.AdminPassword = nil + } // AdminUsername destination.AdminUsername = genruntime.ClonePointerToString(profile.AdminUsername) @@ -9274,7 +9284,6 @@ func (profile *ManagedClusterWindowsProfile) AssignProperties_To_ManagedClusterW // Storage version of v1api20231102preview.ManagedClusterWindowsProfile_STATUS // Profile for Windows VMs in the managed cluster. type ManagedClusterWindowsProfile_STATUS struct { - AdminPassword *string `json:"adminPassword,omitempty"` AdminUsername *string `json:"adminUsername,omitempty"` EnableCSIProxy *bool `json:"enableCSIProxy,omitempty"` GmsaProfile *WindowsGmsaProfile_STATUS `json:"gmsaProfile,omitempty"` @@ -9287,9 +9296,6 @@ func (profile *ManagedClusterWindowsProfile_STATUS) AssignProperties_From_Manage // Clone the existing property bag propertyBag := genruntime.NewPropertyBag(source.PropertyBag) - // AdminPassword - profile.AdminPassword = genruntime.ClonePointerToString(source.AdminPassword) - // AdminUsername profile.AdminUsername = genruntime.ClonePointerToString(source.AdminUsername) @@ -9341,9 +9347,6 @@ func (profile *ManagedClusterWindowsProfile_STATUS) AssignProperties_To_ManagedC // Clone the existing property bag propertyBag := genruntime.NewPropertyBag(profile.PropertyBag) - // AdminPassword - destination.AdminPassword = genruntime.ClonePointerToString(profile.AdminPassword) - // AdminUsername destination.AdminUsername = genruntime.ClonePointerToString(profile.AdminUsername) diff --git a/v2/api/containerservice/v1api20231102preview/storage/managed_cluster_types_gen_test.go b/v2/api/containerservice/v1api20231102preview/storage/managed_cluster_types_gen_test.go index ee625879243..c4afd3aaa75 100644 --- a/v2/api/containerservice/v1api20231102preview/storage/managed_cluster_types_gen_test.go +++ b/v2/api/containerservice/v1api20231102preview/storage/managed_cluster_types_gen_test.go @@ -14059,7 +14059,6 @@ func ManagedClusterWindowsProfileGenerator() gopter.Gen { // AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile is a factory method for creating gopter generators func AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile(gens map[string]gopter.Gen) { - gens["AdminPassword"] = gen.PtrOf(gen.AlphaString()) gens["AdminUsername"] = gen.PtrOf(gen.AlphaString()) gens["EnableCSIProxy"] = gen.PtrOf(gen.Bool()) gens["LicenseType"] = gen.PtrOf(gen.AlphaString()) @@ -14179,7 +14178,6 @@ func ManagedClusterWindowsProfile_STATUSGenerator() gopter.Gen { // AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile_STATUS is a factory method for creating gopter generators func AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile_STATUS(gens map[string]gopter.Gen) { - gens["AdminPassword"] = gen.PtrOf(gen.AlphaString()) gens["AdminUsername"] = gen.PtrOf(gen.AlphaString()) gens["EnableCSIProxy"] = gen.PtrOf(gen.Bool()) gens["LicenseType"] = gen.PtrOf(gen.AlphaString()) diff --git a/v2/api/containerservice/v1api20231102preview/storage/structure.txt b/v2/api/containerservice/v1api20231102preview/storage/structure.txt index 698f2518c80..b34dfc0bf96 100644 --- a/v2/api/containerservice/v1api20231102preview/storage/structure.txt +++ b/v2/api/containerservice/v1api20231102preview/storage/structure.txt @@ -476,7 +476,7 @@ ManagedCluster: Resource │ │ │ └── Until: *string │ │ └── PropertyBag: genruntime.PropertyBag │ ├── WindowsProfile: *Object (6 properties) -│ │ ├── AdminPassword: *string +│ │ ├── AdminPassword: *genruntime.SecretReference │ │ ├── AdminUsername: *string │ │ ├── EnableCSIProxy: *bool │ │ ├── GmsaProfile: *Object (4 properties) @@ -1009,8 +1009,7 @@ ManagedCluster: Resource │ │ ├── PropertyBag: genruntime.PropertyBag │ │ └── Until: *string │ └── PropertyBag: genruntime.PropertyBag - ├── WindowsProfile: *Object (6 properties) - │ ├── AdminPassword: *string + ├── WindowsProfile: *Object (5 properties) │ ├── AdminUsername: *string │ ├── EnableCSIProxy: *bool │ ├── GmsaProfile: *Object (4 properties) diff --git a/v2/api/containerservice/v1api20231102preview/storage/zz_generated.deepcopy.go b/v2/api/containerservice/v1api20231102preview/storage/zz_generated.deepcopy.go index 46557747a8a..115663a90be 100644 --- a/v2/api/containerservice/v1api20231102preview/storage/zz_generated.deepcopy.go +++ b/v2/api/containerservice/v1api20231102preview/storage/zz_generated.deepcopy.go @@ -6255,7 +6255,7 @@ func (in *ManagedClusterWindowsProfile) DeepCopyInto(out *ManagedClusterWindowsP *out = *in if in.AdminPassword != nil { in, out := &in.AdminPassword, &out.AdminPassword - *out = new(string) + *out = new(genruntime.SecretReference) **out = **in } if in.AdminUsername != nil { @@ -6300,11 +6300,6 @@ func (in *ManagedClusterWindowsProfile) DeepCopy() *ManagedClusterWindowsProfile // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ManagedClusterWindowsProfile_STATUS) DeepCopyInto(out *ManagedClusterWindowsProfile_STATUS) { *out = *in - if in.AdminPassword != nil { - in, out := &in.AdminPassword, &out.AdminPassword - *out = new(string) - **out = **in - } if in.AdminUsername != nil { in, out := &in.AdminUsername, &out.AdminUsername *out = new(string) diff --git a/v2/api/containerservice/v1api20231102preview/structure.txt b/v2/api/containerservice/v1api20231102preview/structure.txt index 846af591e34..2c0f21f20c7 100644 --- a/v2/api/containerservice/v1api20231102preview/structure.txt +++ b/v2/api/containerservice/v1api20231102preview/structure.txt @@ -524,7 +524,7 @@ ManagedCluster: Resource │ │ ├── ForceUpgrade: *bool │ │ └── Until: *string │ ├── WindowsProfile: *Object (5 properties) -│ │ ├── AdminPassword: *string +│ │ ├── AdminPassword: *genruntime.SecretReference │ │ ├── AdminUsername: *string │ │ ├── EnableCSIProxy: *bool │ │ ├── GmsaProfile: *Object (3 properties) @@ -1073,8 +1073,7 @@ ManagedCluster: Resource │ └── OverrideSettings: *Object (2 properties) │ ├── ForceUpgrade: *bool │ └── Until: *string - ├── WindowsProfile: *Object (5 properties) - │ ├── AdminPassword: *string + ├── WindowsProfile: *Object (4 properties) │ ├── AdminUsername: *string │ ├── EnableCSIProxy: *bool │ ├── GmsaProfile: *Object (3 properties) @@ -1599,8 +1598,7 @@ ManagedCluster_STATUS_ARM: Object (10 properties) │ │ └── OverrideSettings: *Object (2 properties) │ │ ├── ForceUpgrade: *bool │ │ └── Until: *string -│ ├── WindowsProfile: *Object (5 properties) -│ │ ├── AdminPassword: *string +│ ├── WindowsProfile: *Object (4 properties) │ │ ├── AdminUsername: *string │ │ ├── EnableCSIProxy: *bool │ │ ├── GmsaProfile: *Object (3 properties) diff --git a/v2/api/containerservice/v1api20231102preview/zz_generated.deepcopy.go b/v2/api/containerservice/v1api20231102preview/zz_generated.deepcopy.go index 487c771316a..d2aec927c7b 100644 --- a/v2/api/containerservice/v1api20231102preview/zz_generated.deepcopy.go +++ b/v2/api/containerservice/v1api20231102preview/zz_generated.deepcopy.go @@ -11245,7 +11245,7 @@ func (in *ManagedClusterWindowsProfile) DeepCopyInto(out *ManagedClusterWindowsP *out = *in if in.AdminPassword != nil { in, out := &in.AdminPassword, &out.AdminPassword - *out = new(string) + *out = new(genruntime.SecretReference) **out = **in } if in.AdminUsername != nil { @@ -11323,11 +11323,6 @@ func (in *ManagedClusterWindowsProfile_ARM) DeepCopy() *ManagedClusterWindowsPro // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ManagedClusterWindowsProfile_STATUS) DeepCopyInto(out *ManagedClusterWindowsProfile_STATUS) { *out = *in - if in.AdminPassword != nil { - in, out := &in.AdminPassword, &out.AdminPassword - *out = new(string) - **out = **in - } if in.AdminUsername != nil { in, out := &in.AdminUsername, &out.AdminUsername *out = new(string) @@ -11363,11 +11358,6 @@ func (in *ManagedClusterWindowsProfile_STATUS) DeepCopy() *ManagedClusterWindows // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ManagedClusterWindowsProfile_STATUS_ARM) DeepCopyInto(out *ManagedClusterWindowsProfile_STATUS_ARM) { *out = *in - if in.AdminPassword != nil { - in, out := &in.AdminPassword, &out.AdminPassword - *out = new(string) - **out = **in - } if in.AdminUsername != nil { in, out := &in.AdminUsername, &out.AdminUsername *out = new(string) diff --git a/v2/api/containerservice/v1api20240402preview/managed_cluster_status_arm_types_gen.go b/v2/api/containerservice/v1api20240402preview/managed_cluster_status_arm_types_gen.go index 4012558228e..2980ccd7da3 100644 --- a/v2/api/containerservice/v1api20240402preview/managed_cluster_status_arm_types_gen.go +++ b/v2/api/containerservice/v1api20240402preview/managed_cluster_status_arm_types_gen.go @@ -966,18 +966,6 @@ type ManagedClusterStorageProfile_STATUS_ARM struct { // Profile for Windows VMs in the managed cluster. type ManagedClusterWindowsProfile_STATUS_ARM struct { - // AdminPassword: Specifies the password of the administrator account. - // Minimum-length: 8 characters - // Max-length: 123 characters - // Complexity requirements: 3 out of 4 conditions below need to be fulfilled - // Has lower characters - // Has upper characters - // Has a digit - // Has a special character (Regex match [\W_]) - // Disallowed values: "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", - // "Password22", "iloveyou!" - AdminPassword *string `json:"adminPassword,omitempty"` - // AdminUsername: Specifies the name of the administrator account. // Restriction: Cannot end in "." // Disallowed values: "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", diff --git a/v2/api/containerservice/v1api20240402preview/managed_cluster_status_arm_types_gen_test.go b/v2/api/containerservice/v1api20240402preview/managed_cluster_status_arm_types_gen_test.go index 14e39276f8b..b10ccad4b5b 100644 --- a/v2/api/containerservice/v1api20240402preview/managed_cluster_status_arm_types_gen_test.go +++ b/v2/api/containerservice/v1api20240402preview/managed_cluster_status_arm_types_gen_test.go @@ -5042,7 +5042,6 @@ func ManagedClusterWindowsProfile_STATUS_ARMGenerator() gopter.Gen { // AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile_STATUS_ARM is a factory method for creating gopter generators func AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile_STATUS_ARM(gens map[string]gopter.Gen) { - gens["AdminPassword"] = gen.PtrOf(gen.AlphaString()) gens["AdminUsername"] = gen.PtrOf(gen.AlphaString()) gens["EnableCSIProxy"] = gen.PtrOf(gen.Bool()) gens["LicenseType"] = gen.PtrOf(gen.OneConstOf(ManagedClusterWindowsProfile_LicenseType_STATUS_None, ManagedClusterWindowsProfile_LicenseType_STATUS_Windows_Server)) diff --git a/v2/api/containerservice/v1api20240402preview/managed_cluster_types_gen.go b/v2/api/containerservice/v1api20240402preview/managed_cluster_types_gen.go index 00180c7ac27..c74ce0336a0 100644 --- a/v2/api/containerservice/v1api20240402preview/managed_cluster_types_gen.go +++ b/v2/api/containerservice/v1api20240402preview/managed_cluster_types_gen.go @@ -16506,7 +16506,7 @@ type ManagedClusterWindowsProfile struct { // Has a special character (Regex match [\W_]) // Disallowed values: "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", // "Password22", "iloveyou!" - AdminPassword *string `json:"adminPassword,omitempty"` + AdminPassword *genruntime.SecretReference `json:"adminPassword,omitempty"` // +kubebuilder:validation:Required // AdminUsername: Specifies the name of the administrator account. @@ -16541,7 +16541,11 @@ func (profile *ManagedClusterWindowsProfile) ConvertToARM(resolved genruntime.Co // Set property "AdminPassword": if profile.AdminPassword != nil { - adminPassword := *profile.AdminPassword + adminPasswordSecret, err := resolved.ResolvedSecrets.Lookup(*profile.AdminPassword) + if err != nil { + return nil, errors.Wrap(err, "looking up secret for property AdminPassword") + } + adminPassword := adminPasswordSecret result.AdminPassword = &adminPassword } @@ -16587,11 +16591,7 @@ func (profile *ManagedClusterWindowsProfile) PopulateFromARM(owner genruntime.Ar return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected ManagedClusterWindowsProfile_ARM, got %T", armInput) } - // Set property "AdminPassword": - if typedInput.AdminPassword != nil { - adminPassword := *typedInput.AdminPassword - profile.AdminPassword = &adminPassword - } + // no assignment for property "AdminPassword" // Set property "AdminUsername": if typedInput.AdminUsername != nil { @@ -16630,7 +16630,12 @@ func (profile *ManagedClusterWindowsProfile) PopulateFromARM(owner genruntime.Ar func (profile *ManagedClusterWindowsProfile) AssignProperties_From_ManagedClusterWindowsProfile(source *storage.ManagedClusterWindowsProfile) error { // AdminPassword - profile.AdminPassword = genruntime.ClonePointerToString(source.AdminPassword) + if source.AdminPassword != nil { + adminPassword := source.AdminPassword.Copy() + profile.AdminPassword = &adminPassword + } else { + profile.AdminPassword = nil + } // AdminUsername profile.AdminUsername = genruntime.ClonePointerToString(source.AdminUsername) @@ -16674,7 +16679,12 @@ func (profile *ManagedClusterWindowsProfile) AssignProperties_To_ManagedClusterW propertyBag := genruntime.NewPropertyBag() // AdminPassword - destination.AdminPassword = genruntime.ClonePointerToString(profile.AdminPassword) + if profile.AdminPassword != nil { + adminPassword := profile.AdminPassword.Copy() + destination.AdminPassword = &adminPassword + } else { + destination.AdminPassword = nil + } // AdminUsername destination.AdminUsername = genruntime.ClonePointerToString(profile.AdminUsername) @@ -16720,18 +16730,6 @@ func (profile *ManagedClusterWindowsProfile) AssignProperties_To_ManagedClusterW // Profile for Windows VMs in the managed cluster. type ManagedClusterWindowsProfile_STATUS struct { - // AdminPassword: Specifies the password of the administrator account. - // Minimum-length: 8 characters - // Max-length: 123 characters - // Complexity requirements: 3 out of 4 conditions below need to be fulfilled - // Has lower characters - // Has upper characters - // Has a digit - // Has a special character (Regex match [\W_]) - // Disallowed values: "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", - // "Password22", "iloveyou!" - AdminPassword *string `json:"adminPassword,omitempty"` - // AdminUsername: Specifies the name of the administrator account. // Restriction: Cannot end in "." // Disallowed values: "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", @@ -16767,12 +16765,6 @@ func (profile *ManagedClusterWindowsProfile_STATUS) PopulateFromARM(owner genrun return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected ManagedClusterWindowsProfile_STATUS_ARM, got %T", armInput) } - // Set property "AdminPassword": - if typedInput.AdminPassword != nil { - adminPassword := *typedInput.AdminPassword - profile.AdminPassword = &adminPassword - } - // Set property "AdminUsername": if typedInput.AdminUsername != nil { adminUsername := *typedInput.AdminUsername @@ -16809,9 +16801,6 @@ func (profile *ManagedClusterWindowsProfile_STATUS) PopulateFromARM(owner genrun // AssignProperties_From_ManagedClusterWindowsProfile_STATUS populates our ManagedClusterWindowsProfile_STATUS from the provided source ManagedClusterWindowsProfile_STATUS func (profile *ManagedClusterWindowsProfile_STATUS) AssignProperties_From_ManagedClusterWindowsProfile_STATUS(source *storage.ManagedClusterWindowsProfile_STATUS) error { - // AdminPassword - profile.AdminPassword = genruntime.ClonePointerToString(source.AdminPassword) - // AdminUsername profile.AdminUsername = genruntime.ClonePointerToString(source.AdminUsername) @@ -16853,9 +16842,6 @@ func (profile *ManagedClusterWindowsProfile_STATUS) AssignProperties_To_ManagedC // Create a new property bag propertyBag := genruntime.NewPropertyBag() - // AdminPassword - destination.AdminPassword = genruntime.ClonePointerToString(profile.AdminPassword) - // AdminUsername destination.AdminUsername = genruntime.ClonePointerToString(profile.AdminUsername) diff --git a/v2/api/containerservice/v1api20240402preview/managed_cluster_types_gen_test.go b/v2/api/containerservice/v1api20240402preview/managed_cluster_types_gen_test.go index c2940916d34..a07ddf08d0f 100644 --- a/v2/api/containerservice/v1api20240402preview/managed_cluster_types_gen_test.go +++ b/v2/api/containerservice/v1api20240402preview/managed_cluster_types_gen_test.go @@ -15761,7 +15761,6 @@ func ManagedClusterWindowsProfileGenerator() gopter.Gen { // AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile is a factory method for creating gopter generators func AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile(gens map[string]gopter.Gen) { - gens["AdminPassword"] = gen.PtrOf(gen.AlphaString()) gens["AdminUsername"] = gen.PtrOf(gen.AlphaString()) gens["EnableCSIProxy"] = gen.PtrOf(gen.Bool()) gens["LicenseType"] = gen.PtrOf(gen.OneConstOf(ManagedClusterWindowsProfile_LicenseType_None, ManagedClusterWindowsProfile_LicenseType_Windows_Server)) @@ -15881,7 +15880,6 @@ func ManagedClusterWindowsProfile_STATUSGenerator() gopter.Gen { // AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile_STATUS is a factory method for creating gopter generators func AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile_STATUS(gens map[string]gopter.Gen) { - gens["AdminPassword"] = gen.PtrOf(gen.AlphaString()) gens["AdminUsername"] = gen.PtrOf(gen.AlphaString()) gens["EnableCSIProxy"] = gen.PtrOf(gen.Bool()) gens["LicenseType"] = gen.PtrOf(gen.OneConstOf(ManagedClusterWindowsProfile_LicenseType_STATUS_None, ManagedClusterWindowsProfile_LicenseType_STATUS_Windows_Server)) diff --git a/v2/api/containerservice/v1api20240402preview/storage/managed_cluster_types_gen.go b/v2/api/containerservice/v1api20240402preview/storage/managed_cluster_types_gen.go index 5ecb2b02980..9c8ba948e37 100644 --- a/v2/api/containerservice/v1api20240402preview/storage/managed_cluster_types_gen.go +++ b/v2/api/containerservice/v1api20240402preview/storage/managed_cluster_types_gen.go @@ -9971,12 +9971,12 @@ func (profile *ManagedClusterStorageProfile_STATUS) AssignProperties_To_ManagedC // Storage version of v1api20240402preview.ManagedClusterWindowsProfile // Profile for Windows VMs in the managed cluster. type ManagedClusterWindowsProfile struct { - AdminPassword *string `json:"adminPassword,omitempty"` - AdminUsername *string `json:"adminUsername,omitempty"` - EnableCSIProxy *bool `json:"enableCSIProxy,omitempty"` - GmsaProfile *WindowsGmsaProfile `json:"gmsaProfile,omitempty"` - LicenseType *string `json:"licenseType,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + AdminPassword *genruntime.SecretReference `json:"adminPassword,omitempty"` + AdminUsername *string `json:"adminUsername,omitempty"` + EnableCSIProxy *bool `json:"enableCSIProxy,omitempty"` + GmsaProfile *WindowsGmsaProfile `json:"gmsaProfile,omitempty"` + LicenseType *string `json:"licenseType,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` } // AssignProperties_From_ManagedClusterWindowsProfile populates our ManagedClusterWindowsProfile from the provided source ManagedClusterWindowsProfile @@ -9985,7 +9985,12 @@ func (profile *ManagedClusterWindowsProfile) AssignProperties_From_ManagedCluste propertyBag := genruntime.NewPropertyBag(source.PropertyBag) // AdminPassword - profile.AdminPassword = genruntime.ClonePointerToString(source.AdminPassword) + if source.AdminPassword != nil { + adminPassword := source.AdminPassword.Copy() + profile.AdminPassword = &adminPassword + } else { + profile.AdminPassword = nil + } // AdminUsername profile.AdminUsername = genruntime.ClonePointerToString(source.AdminUsername) @@ -10039,7 +10044,12 @@ func (profile *ManagedClusterWindowsProfile) AssignProperties_To_ManagedClusterW propertyBag := genruntime.NewPropertyBag(profile.PropertyBag) // AdminPassword - destination.AdminPassword = genruntime.ClonePointerToString(profile.AdminPassword) + if profile.AdminPassword != nil { + adminPassword := profile.AdminPassword.Copy() + destination.AdminPassword = &adminPassword + } else { + destination.AdminPassword = nil + } // AdminUsername destination.AdminUsername = genruntime.ClonePointerToString(profile.AdminUsername) @@ -10090,7 +10100,6 @@ func (profile *ManagedClusterWindowsProfile) AssignProperties_To_ManagedClusterW // Storage version of v1api20240402preview.ManagedClusterWindowsProfile_STATUS // Profile for Windows VMs in the managed cluster. type ManagedClusterWindowsProfile_STATUS struct { - AdminPassword *string `json:"adminPassword,omitempty"` AdminUsername *string `json:"adminUsername,omitempty"` EnableCSIProxy *bool `json:"enableCSIProxy,omitempty"` GmsaProfile *WindowsGmsaProfile_STATUS `json:"gmsaProfile,omitempty"` @@ -10103,9 +10112,6 @@ func (profile *ManagedClusterWindowsProfile_STATUS) AssignProperties_From_Manage // Clone the existing property bag propertyBag := genruntime.NewPropertyBag(source.PropertyBag) - // AdminPassword - profile.AdminPassword = genruntime.ClonePointerToString(source.AdminPassword) - // AdminUsername profile.AdminUsername = genruntime.ClonePointerToString(source.AdminUsername) @@ -10157,9 +10163,6 @@ func (profile *ManagedClusterWindowsProfile_STATUS) AssignProperties_To_ManagedC // Clone the existing property bag propertyBag := genruntime.NewPropertyBag(profile.PropertyBag) - // AdminPassword - destination.AdminPassword = genruntime.ClonePointerToString(profile.AdminPassword) - // AdminUsername destination.AdminUsername = genruntime.ClonePointerToString(profile.AdminUsername) diff --git a/v2/api/containerservice/v1api20240402preview/storage/managed_cluster_types_gen_test.go b/v2/api/containerservice/v1api20240402preview/storage/managed_cluster_types_gen_test.go index 39950a7f90a..5551c816f70 100644 --- a/v2/api/containerservice/v1api20240402preview/storage/managed_cluster_types_gen_test.go +++ b/v2/api/containerservice/v1api20240402preview/storage/managed_cluster_types_gen_test.go @@ -15205,7 +15205,6 @@ func ManagedClusterWindowsProfileGenerator() gopter.Gen { // AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile is a factory method for creating gopter generators func AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile(gens map[string]gopter.Gen) { - gens["AdminPassword"] = gen.PtrOf(gen.AlphaString()) gens["AdminUsername"] = gen.PtrOf(gen.AlphaString()) gens["EnableCSIProxy"] = gen.PtrOf(gen.Bool()) gens["LicenseType"] = gen.PtrOf(gen.AlphaString()) @@ -15325,7 +15324,6 @@ func ManagedClusterWindowsProfile_STATUSGenerator() gopter.Gen { // AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile_STATUS is a factory method for creating gopter generators func AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile_STATUS(gens map[string]gopter.Gen) { - gens["AdminPassword"] = gen.PtrOf(gen.AlphaString()) gens["AdminUsername"] = gen.PtrOf(gen.AlphaString()) gens["EnableCSIProxy"] = gen.PtrOf(gen.Bool()) gens["LicenseType"] = gen.PtrOf(gen.AlphaString()) diff --git a/v2/api/containerservice/v1api20240402preview/storage/structure.txt b/v2/api/containerservice/v1api20240402preview/storage/structure.txt index 22b047233de..a93c2d0d438 100644 --- a/v2/api/containerservice/v1api20240402preview/storage/structure.txt +++ b/v2/api/containerservice/v1api20240402preview/storage/structure.txt @@ -502,7 +502,7 @@ ManagedCluster: Resource │ │ │ └── Until: *string │ │ └── PropertyBag: genruntime.PropertyBag │ ├── WindowsProfile: *Object (6 properties) -│ │ ├── AdminPassword: *string +│ │ ├── AdminPassword: *genruntime.SecretReference │ │ ├── AdminUsername: *string │ │ ├── EnableCSIProxy: *bool │ │ ├── GmsaProfile: *Object (4 properties) @@ -1063,8 +1063,7 @@ ManagedCluster: Resource │ │ ├── PropertyBag: genruntime.PropertyBag │ │ └── Until: *string │ └── PropertyBag: genruntime.PropertyBag - ├── WindowsProfile: *Object (6 properties) - │ ├── AdminPassword: *string + ├── WindowsProfile: *Object (5 properties) │ ├── AdminUsername: *string │ ├── EnableCSIProxy: *bool │ ├── GmsaProfile: *Object (4 properties) diff --git a/v2/api/containerservice/v1api20240402preview/storage/zz_generated.deepcopy.go b/v2/api/containerservice/v1api20240402preview/storage/zz_generated.deepcopy.go index 22cd90b55a4..5491d0d9622 100644 --- a/v2/api/containerservice/v1api20240402preview/storage/zz_generated.deepcopy.go +++ b/v2/api/containerservice/v1api20240402preview/storage/zz_generated.deepcopy.go @@ -6710,7 +6710,7 @@ func (in *ManagedClusterWindowsProfile) DeepCopyInto(out *ManagedClusterWindowsP *out = *in if in.AdminPassword != nil { in, out := &in.AdminPassword, &out.AdminPassword - *out = new(string) + *out = new(genruntime.SecretReference) **out = **in } if in.AdminUsername != nil { @@ -6755,11 +6755,6 @@ func (in *ManagedClusterWindowsProfile) DeepCopy() *ManagedClusterWindowsProfile // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ManagedClusterWindowsProfile_STATUS) DeepCopyInto(out *ManagedClusterWindowsProfile_STATUS) { *out = *in - if in.AdminPassword != nil { - in, out := &in.AdminPassword, &out.AdminPassword - *out = new(string) - **out = **in - } if in.AdminUsername != nil { in, out := &in.AdminUsername, &out.AdminUsername *out = new(string) diff --git a/v2/api/containerservice/v1api20240402preview/structure.txt b/v2/api/containerservice/v1api20240402preview/structure.txt index 8d626222924..0f3465e210e 100644 --- a/v2/api/containerservice/v1api20240402preview/structure.txt +++ b/v2/api/containerservice/v1api20240402preview/structure.txt @@ -558,7 +558,7 @@ ManagedCluster: Resource │ │ ├── ForceUpgrade: *bool │ │ └── Until: *string │ ├── WindowsProfile: *Object (5 properties) -│ │ ├── AdminPassword: *string +│ │ ├── AdminPassword: *genruntime.SecretReference │ │ ├── AdminUsername: *string │ │ ├── EnableCSIProxy: *bool │ │ ├── GmsaProfile: *Object (3 properties) @@ -1143,8 +1143,7 @@ ManagedCluster: Resource │ └── OverrideSettings: *Object (2 properties) │ ├── ForceUpgrade: *bool │ └── Until: *string - ├── WindowsProfile: *Object (5 properties) - │ ├── AdminPassword: *string + ├── WindowsProfile: *Object (4 properties) │ ├── AdminUsername: *string │ ├── EnableCSIProxy: *bool │ ├── GmsaProfile: *Object (3 properties) @@ -1704,8 +1703,7 @@ ManagedCluster_STATUS_ARM: Object (12 properties) │ │ └── OverrideSettings: *Object (2 properties) │ │ ├── ForceUpgrade: *bool │ │ └── Until: *string -│ ├── WindowsProfile: *Object (5 properties) -│ │ ├── AdminPassword: *string +│ ├── WindowsProfile: *Object (4 properties) │ │ ├── AdminUsername: *string │ │ ├── EnableCSIProxy: *bool │ │ ├── GmsaProfile: *Object (3 properties) diff --git a/v2/api/containerservice/v1api20240402preview/zz_generated.deepcopy.go b/v2/api/containerservice/v1api20240402preview/zz_generated.deepcopy.go index 1663a59c746..be7d8b6b1fa 100644 --- a/v2/api/containerservice/v1api20240402preview/zz_generated.deepcopy.go +++ b/v2/api/containerservice/v1api20240402preview/zz_generated.deepcopy.go @@ -12022,7 +12022,7 @@ func (in *ManagedClusterWindowsProfile) DeepCopyInto(out *ManagedClusterWindowsP *out = *in if in.AdminPassword != nil { in, out := &in.AdminPassword, &out.AdminPassword - *out = new(string) + *out = new(genruntime.SecretReference) **out = **in } if in.AdminUsername != nil { @@ -12100,11 +12100,6 @@ func (in *ManagedClusterWindowsProfile_ARM) DeepCopy() *ManagedClusterWindowsPro // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ManagedClusterWindowsProfile_STATUS) DeepCopyInto(out *ManagedClusterWindowsProfile_STATUS) { *out = *in - if in.AdminPassword != nil { - in, out := &in.AdminPassword, &out.AdminPassword - *out = new(string) - **out = **in - } if in.AdminUsername != nil { in, out := &in.AdminUsername, &out.AdminUsername *out = new(string) @@ -12140,11 +12135,6 @@ func (in *ManagedClusterWindowsProfile_STATUS) DeepCopy() *ManagedClusterWindows // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ManagedClusterWindowsProfile_STATUS_ARM) DeepCopyInto(out *ManagedClusterWindowsProfile_STATUS_ARM) { *out = *in - if in.AdminPassword != nil { - in, out := &in.AdminPassword, &out.AdminPassword - *out = new(string) - **out = **in - } if in.AdminUsername != nil { in, out := &in.AdminUsername, &out.AdminUsername *out = new(string) diff --git a/v2/azure-arm.yaml b/v2/azure-arm.yaml index 20976410e7a..1dead87fb47 100644 --- a/v2/azure-arm.yaml +++ b/v2/azure-arm.yaml @@ -1529,6 +1529,9 @@ objectModelConfiguration: ManagedClusterServicePrincipalProfile: Secret: $isSecret: true + ManagedClusterWindowsProfile: + AdminPassword: + $isSecret: true PrivateLinkResource: Id: $armReference: true @@ -1565,6 +1568,9 @@ objectModelConfiguration: ManagedClusterServicePrincipalProfile: Secret: $isSecret: true + ManagedClusterWindowsProfile: + AdminPassword: + $isSecret: true PrivateLinkResource: Id: $armReference: true @@ -1604,6 +1610,9 @@ objectModelConfiguration: ManagedClusters_TrustedAccessRoleBinding: $exportAs: TrustedAccessRoleBinding $supportedFrom: v2.2.0 + ManagedClusterWindowsProfile: + AdminPassword: + $isSecret: true TrustedAccessRoleBindingProperties: SourceResourceId: $armReference: true @@ -1660,6 +1669,9 @@ objectModelConfiguration: ManagedClusterServicePrincipalProfile: Secret: $isSecret: true + ManagedClusterWindowsProfile: + AdminPassword: + $isSecret: true PrivateLinkResource: Id: $armReference: true @@ -1701,6 +1713,9 @@ objectModelConfiguration: ManagedClusterServicePrincipalProfile: Secret: $isSecret: true + ManagedClusterWindowsProfile: + AdminPassword: + $isSecret: true PrivateLinkResource: Id: $armReference: true @@ -1739,6 +1754,9 @@ objectModelConfiguration: ManagedClusterServicePrincipalProfile: Secret: $isSecret: true + ManagedClusterWindowsProfile: + AdminPassword: + $isSecret: true PrivateLinkResource: Id: $armReference: true diff --git a/v2/internal/controllers/controller_resources_gen.go b/v2/internal/controllers/controller_resources_gen.go index e9b2e27262f..2c6546b7d09 100644 --- a/v2/internal/controllers/controller_resources_gen.go +++ b/v2/internal/controllers/controller_resources_gen.go @@ -525,6 +525,10 @@ func getKnownStorageTypes() []*registration.StorageType { result = append(result, ®istration.StorageType{ Obj: new(containerservice_v20231001s.ManagedCluster), Indexes: []registration.Index{ + { + Key: ".spec.windowsProfile.adminPassword", + Func: indexContainerserviceManagedClusterAdminPassword, + }, { Key: ".spec.servicePrincipalProfile.secret", Func: indexContainerserviceManagedClusterSecret, @@ -533,7 +537,7 @@ func getKnownStorageTypes() []*registration.StorageType { Watches: []registration.Watch{ { Type: &v1.Secret{}, - MakeEventHandler: watchSecretsFactory([]string{".spec.servicePrincipalProfile.secret"}, &containerservice_v20231001s.ManagedClusterList{}), + MakeEventHandler: watchSecretsFactory([]string{".spec.servicePrincipalProfile.secret", ".spec.windowsProfile.adminPassword"}, &containerservice_v20231001s.ManagedClusterList{}), }, }, }) @@ -2781,6 +2785,21 @@ func indexContainerinstanceContainerGroupWorkspaceKey(rawObj client.Object) []st return obj.Spec.Diagnostics.LogAnalytics.WorkspaceKey.Index() } +// indexContainerserviceManagedClusterAdminPassword an index function for containerservice_v20231001s.ManagedCluster .spec.windowsProfile.adminPassword +func indexContainerserviceManagedClusterAdminPassword(rawObj client.Object) []string { + obj, ok := rawObj.(*containerservice_v20231001s.ManagedCluster) + if !ok { + return nil + } + if obj.Spec.WindowsProfile == nil { + return nil + } + if obj.Spec.WindowsProfile.AdminPassword == nil { + return nil + } + return obj.Spec.WindowsProfile.AdminPassword.Index() +} + // indexContainerserviceManagedClusterSecret an index function for containerservice_v20231001s.ManagedCluster .spec.servicePrincipalProfile.secret func indexContainerserviceManagedClusterSecret(rawObj client.Object) []string { obj, ok := rawObj.(*containerservice_v20231001s.ManagedCluster) diff --git a/v2/tools/generator/internal/codegen/pipeline/add_secrets.go b/v2/tools/generator/internal/codegen/pipeline/add_secrets.go index 401dc57a86e..2f7a60a73b8 100644 --- a/v2/tools/generator/internal/codegen/pipeline/add_secrets.go +++ b/v2/tools/generator/internal/codegen/pipeline/add_secrets.go @@ -47,7 +47,10 @@ func AddSecrets(config *config.Configuration) *Stage { return stage } -func applyConfigSecretOverrides(config *config.Configuration, definitions astmodel.TypeDefinitionSet) (astmodel.TypeDefinitionSet, error) { +func applyConfigSecretOverrides( + config *config.Configuration, + definitions astmodel.TypeDefinitionSet, +) (astmodel.TypeDefinitionSet, error) { result := make(astmodel.TypeDefinitionSet) applyConfigSecrets := func( @@ -58,14 +61,24 @@ func applyConfigSecretOverrides(config *config.Configuration, definitions astmod strippedTypeName := ctx.WithName(strings.TrimSuffix(ctx.Name(), astmodel.StatusSuffix)) for _, prop := range it.Properties().Copy() { - if isSecret, ok := config.ObjectModelConfiguration.IsSecret.Lookup(ctx, prop.PropertyName()); ok && isSecret { - it = it.WithProperty(prop.WithIsSecret(true)) + maybeSecret := mightBeSecretProperty(prop, definitions) + + isSecret, isSecretConfigured := config.ObjectModelConfiguration.IsSecret.Lookup(ctx, prop.PropertyName()) + if ctx.IsStatus() && !isSecretConfigured { + isSecret, isSecretConfigured = config.ObjectModelConfiguration.IsSecret.Lookup(strippedTypeName, prop.PropertyName()) + } + + if maybeSecret && !prop.IsSecret() && !isSecretConfigured { + // Property might be a secret, but isn't already configured as one, + // and we don't have config to tell us for sure + return nil, errors.Errorf( + "property %q might be a secret and must to be configured with $isSecret", + prop.PropertyName()) } - if ctx.IsStatus() { - if isSecret, ok := config.ObjectModelConfiguration.IsSecret.Lookup(strippedTypeName, prop.PropertyName()); ok && isSecret { - it = it.WithProperty(prop.WithIsSecret(true)) - } + if isSecretConfigured { + propWithSecret := prop.WithIsSecret(isSecret) + it = it.WithProperty(propWithSecret) } } @@ -77,6 +90,11 @@ func applyConfigSecretOverrides(config *config.Configuration, definitions astmod }.Build() for _, def := range definitions { + if def.Name().IsARMType() { + // No need to process ARM types + continue + } + updatedDef, err := visitor.VisitDefinition(def, def.Name()) if err != nil { return nil, errors.Wrapf(err, "visiting type %q", def.Name()) @@ -96,6 +114,48 @@ func applyConfigSecretOverrides(config *config.Configuration, definitions astmod return result, nil } +// mightBeSecret returns true if the given name might represent a secret that shouldn't be present +// in plain text in the resource. This is a heuristic used to require the presence of $isSecret +// configuration so that we know for sure. +// property is the property to check +// definitions is the set of all definitions so we can look up a typename +func mightBeSecretProperty( + prop *astmodel.PropertyDefinition, + definitions astmodel.TypeDefinitionSet, +) bool { + // Only properties that are strings can be secrets + propertyType := prop.PropertyType() + + // Look through a reference if we have one + if tn, ok := astmodel.AsInternalTypeName(propertyType); ok { + if def, ok := definitions[tn]; ok { + propertyType = def.Type() + } + } + + // If not a string type, can't be a secret + pt, ok := astmodel.AsPrimitiveType(propertyType) + if !ok || pt != astmodel.StringType { + return false + } + + // If the property name contains any of the secret words, it might be a secret + n := strings.ToLower(string(prop.PropertyName())) + for _, secretWord := range secretWords { + if strings.Contains(n, secretWord) { + return true + } + } + + return false +} + +// A list of secret words to scan for. +// Lowercase only, please. +var secretWords = []string{ + "password", +} + func transformSpecSecrets(definitions astmodel.TypeDefinitionSet) (astmodel.TypeDefinitionSet, error) { specVisitor := astmodel.TypeVisitorBuilder[any]{ VisitObjectType: transformSecretProperties,