Skip to content

Commit

Permalink
OCM-7288 | feat: add managementUpgrade parameters to NodePool model
Browse files Browse the repository at this point in the history
OCM-7374 | feat: add AdditionalAllowedPrincipals to aws model
  • Loading branch information
philipwu08 committed May 30, 2024
1 parent 15e90bd commit 42a193a
Show file tree
Hide file tree
Showing 14 changed files with 12,661 additions and 11,708 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export PATH := $(LOCAL_BIN_PATH):$(PATH)
export CGO_ENABLED=0

# Details of the model to use:
model_version:=v0.0.374
model_version:=v0.0.375
model_url:=https://github.com/openshift-online/ocm-api-model.git

# Details of the metamodel to use:
Expand Down
55 changes: 37 additions & 18 deletions clustersmgmt/v1/aws_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ type AWSBuilder struct {
sts *STSBuilder
accessKeyID string
accountID string
additionalAllowedPrincipals []string
additionalComputeSecurityGroupIds []string
additionalControlPlaneSecurityGroupIds []string
additionalInfraSecurityGroupIds []string
Expand Down Expand Up @@ -88,27 +89,35 @@ func (b *AWSBuilder) AccountID(value string) *AWSBuilder {
return b
}

// AdditionalAllowedPrincipals sets the value of the 'additional_allowed_principals' attribute to the given values.
func (b *AWSBuilder) AdditionalAllowedPrincipals(values ...string) *AWSBuilder {
b.additionalAllowedPrincipals = make([]string, len(values))
copy(b.additionalAllowedPrincipals, values)
b.bitmap_ |= 16
return b
}

// AdditionalComputeSecurityGroupIds sets the value of the 'additional_compute_security_group_ids' attribute to the given values.
func (b *AWSBuilder) AdditionalComputeSecurityGroupIds(values ...string) *AWSBuilder {
b.additionalComputeSecurityGroupIds = make([]string, len(values))
copy(b.additionalComputeSecurityGroupIds, values)
b.bitmap_ |= 16
b.bitmap_ |= 32
return b
}

// AdditionalControlPlaneSecurityGroupIds sets the value of the 'additional_control_plane_security_group_ids' attribute to the given values.
func (b *AWSBuilder) AdditionalControlPlaneSecurityGroupIds(values ...string) *AWSBuilder {
b.additionalControlPlaneSecurityGroupIds = make([]string, len(values))
copy(b.additionalControlPlaneSecurityGroupIds, values)
b.bitmap_ |= 32
b.bitmap_ |= 64
return b
}

// AdditionalInfraSecurityGroupIds sets the value of the 'additional_infra_security_group_ids' attribute to the given values.
func (b *AWSBuilder) AdditionalInfraSecurityGroupIds(values ...string) *AWSBuilder {
b.additionalInfraSecurityGroupIds = make([]string, len(values))
copy(b.additionalInfraSecurityGroupIds, values)
b.bitmap_ |= 64
b.bitmap_ |= 128
return b
}

Expand All @@ -118,17 +127,17 @@ func (b *AWSBuilder) AdditionalInfraSecurityGroupIds(values ...string) *AWSBuild
func (b *AWSBuilder) AuditLog(value *AuditLogBuilder) *AWSBuilder {
b.auditLog = value
if value != nil {
b.bitmap_ |= 128
b.bitmap_ |= 256
} else {
b.bitmap_ &^= 128
b.bitmap_ &^= 256
}
return b
}

// BillingAccountID sets the value of the 'billing_account_ID' attribute to the given value.
func (b *AWSBuilder) BillingAccountID(value string) *AWSBuilder {
b.billingAccountID = value
b.bitmap_ |= 256
b.bitmap_ |= 512
return b
}

Expand All @@ -137,7 +146,7 @@ func (b *AWSBuilder) BillingAccountID(value string) *AWSBuilder {
// Which Ec2MetadataHttpTokens to use for metadata service interaction options for EC2 instances
func (b *AWSBuilder) Ec2MetadataHttpTokens(value Ec2MetadataHttpTokens) *AWSBuilder {
b.ec2MetadataHttpTokens = value
b.bitmap_ |= 512
b.bitmap_ |= 1024
return b
}

Expand All @@ -147,31 +156,31 @@ func (b *AWSBuilder) Ec2MetadataHttpTokens(value Ec2MetadataHttpTokens) *AWSBuil
func (b *AWSBuilder) EtcdEncryption(value *AwsEtcdEncryptionBuilder) *AWSBuilder {
b.etcdEncryption = value
if value != nil {
b.bitmap_ |= 1024
b.bitmap_ |= 2048
} else {
b.bitmap_ &^= 1024
b.bitmap_ &^= 2048
}
return b
}

// PrivateHostedZoneID sets the value of the 'private_hosted_zone_ID' attribute to the given value.
func (b *AWSBuilder) PrivateHostedZoneID(value string) *AWSBuilder {
b.privateHostedZoneID = value
b.bitmap_ |= 2048
b.bitmap_ |= 4096
return b
}

// PrivateHostedZoneRoleARN sets the value of the 'private_hosted_zone_role_ARN' attribute to the given value.
func (b *AWSBuilder) PrivateHostedZoneRoleARN(value string) *AWSBuilder {
b.privateHostedZoneRoleARN = value
b.bitmap_ |= 4096
b.bitmap_ |= 8192
return b
}

// PrivateLink sets the value of the 'private_link' attribute to the given value.
func (b *AWSBuilder) PrivateLink(value bool) *AWSBuilder {
b.privateLink = value
b.bitmap_ |= 8192
b.bitmap_ |= 16384
return b
}

Expand All @@ -181,35 +190,35 @@ func (b *AWSBuilder) PrivateLink(value bool) *AWSBuilder {
func (b *AWSBuilder) PrivateLinkConfiguration(value *PrivateLinkClusterConfigurationBuilder) *AWSBuilder {
b.privateLinkConfiguration = value
if value != nil {
b.bitmap_ |= 16384
b.bitmap_ |= 32768
} else {
b.bitmap_ &^= 16384
b.bitmap_ &^= 32768
}
return b
}

// SecretAccessKey sets the value of the 'secret_access_key' attribute to the given value.
func (b *AWSBuilder) SecretAccessKey(value string) *AWSBuilder {
b.secretAccessKey = value
b.bitmap_ |= 32768
b.bitmap_ |= 65536
return b
}

// SubnetIDs sets the value of the 'subnet_IDs' attribute to the given values.
func (b *AWSBuilder) SubnetIDs(values ...string) *AWSBuilder {
b.subnetIDs = make([]string, len(values))
copy(b.subnetIDs, values)
b.bitmap_ |= 65536
b.bitmap_ |= 131072
return b
}

// Tags sets the value of the 'tags' attribute to the given value.
func (b *AWSBuilder) Tags(value map[string]string) *AWSBuilder {
b.tags = value
if value != nil {
b.bitmap_ |= 131072
b.bitmap_ |= 262144
} else {
b.bitmap_ &^= 131072
b.bitmap_ &^= 262144
}
return b
}
Expand All @@ -228,6 +237,12 @@ func (b *AWSBuilder) Copy(object *AWS) *AWSBuilder {
}
b.accessKeyID = object.accessKeyID
b.accountID = object.accountID
if object.additionalAllowedPrincipals != nil {
b.additionalAllowedPrincipals = make([]string, len(object.additionalAllowedPrincipals))
copy(b.additionalAllowedPrincipals, object.additionalAllowedPrincipals)
} else {
b.additionalAllowedPrincipals = nil
}
if object.additionalComputeSecurityGroupIds != nil {
b.additionalComputeSecurityGroupIds = make([]string, len(object.additionalComputeSecurityGroupIds))
copy(b.additionalComputeSecurityGroupIds, object.additionalComputeSecurityGroupIds)
Expand Down Expand Up @@ -297,6 +312,10 @@ func (b *AWSBuilder) Build() (object *AWS, err error) {
}
object.accessKeyID = b.accessKeyID
object.accountID = b.accountID
if b.additionalAllowedPrincipals != nil {
object.additionalAllowedPrincipals = make([]string, len(b.additionalAllowedPrincipals))
copy(object.additionalAllowedPrincipals, b.additionalAllowedPrincipals)
}
if b.additionalComputeSecurityGroupIds != nil {
object.additionalComputeSecurityGroupIds = make([]string, len(b.additionalComputeSecurityGroupIds))
copy(object.additionalComputeSecurityGroupIds, b.additionalComputeSecurityGroupIds)
Expand Down
Loading

0 comments on commit 42a193a

Please sign in to comment.