Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCM-12240 | feat: include hcp shared vpc support #1010

Merged
merged 2 commits into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
This document describes the relevant changes between releases of the OCM API
SDK.

## 0.1.448
- Update model version v0.0.401
- Include support for HCP shared vpc fields in `Cluster` and `DNS` models.

## 0.1.447
- Update model version v0.0.400
- Update ocm-sdk-go examples for Addons
Expand Down
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.400
model_version:=v0.0.401
model_url:=https://github.com/openshift-online/ocm-api-model.git

# Details of the metamodel to use:
Expand Down
38 changes: 29 additions & 9 deletions clustersmgmt/v1/aws_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,14 @@ type AWSBuilder struct {
billingAccountID string
ec2MetadataHttpTokens Ec2MetadataHttpTokens
etcdEncryption *AwsEtcdEncryptionBuilder
hcpInternalCommunicationHostedZoneId string
privateHostedZoneID string
privateHostedZoneRoleARN string
privateLinkConfiguration *PrivateLinkClusterConfigurationBuilder
secretAccessKey string
subnetIDs []string
tags map[string]string
vpcEndpointRoleArn string
privateLink bool
}

Expand Down Expand Up @@ -163,24 +165,31 @@ func (b *AWSBuilder) EtcdEncryption(value *AwsEtcdEncryptionBuilder) *AWSBuilder
return b
}

// HcpInternalCommunicationHostedZoneId sets the value of the 'hcp_internal_communication_hosted_zone_id' attribute to the given value.
func (b *AWSBuilder) HcpInternalCommunicationHostedZoneId(value string) *AWSBuilder {
b.hcpInternalCommunicationHostedZoneId = value
b.bitmap_ |= 4096
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_ |= 4096
b.bitmap_ |= 8192
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_ |= 8192
b.bitmap_ |= 16384
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_ |= 16384
b.bitmap_ |= 32768
return b
}

Expand All @@ -190,39 +199,46 @@ func (b *AWSBuilder) PrivateLink(value bool) *AWSBuilder {
func (b *AWSBuilder) PrivateLinkConfiguration(value *PrivateLinkClusterConfigurationBuilder) *AWSBuilder {
b.privateLinkConfiguration = value
if value != nil {
b.bitmap_ |= 32768
b.bitmap_ |= 65536
} else {
b.bitmap_ &^= 32768
b.bitmap_ &^= 65536
}
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_ |= 65536
b.bitmap_ |= 131072
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_ |= 131072
b.bitmap_ |= 262144
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_ |= 262144
b.bitmap_ |= 524288
} else {
b.bitmap_ &^= 262144
b.bitmap_ &^= 524288
}
return b
}

// VpcEndpointRoleArn sets the value of the 'vpc_endpoint_role_arn' attribute to the given value.
func (b *AWSBuilder) VpcEndpointRoleArn(value string) *AWSBuilder {
b.vpcEndpointRoleArn = value
b.bitmap_ |= 1048576
return b
}

// Copy copies the attributes of the given object into this builder, discarding any previous values.
func (b *AWSBuilder) Copy(object *AWS) *AWSBuilder {
if object == nil {
Expand Down Expand Up @@ -273,6 +289,7 @@ func (b *AWSBuilder) Copy(object *AWS) *AWSBuilder {
} else {
b.etcdEncryption = nil
}
b.hcpInternalCommunicationHostedZoneId = object.hcpInternalCommunicationHostedZoneId
b.privateHostedZoneID = object.privateHostedZoneID
b.privateHostedZoneRoleARN = object.privateHostedZoneRoleARN
b.privateLink = object.privateLink
Expand All @@ -296,6 +313,7 @@ func (b *AWSBuilder) Copy(object *AWS) *AWSBuilder {
} else {
b.tags = nil
}
b.vpcEndpointRoleArn = object.vpcEndpointRoleArn
return b
}

Expand Down Expand Up @@ -342,6 +360,7 @@ func (b *AWSBuilder) Build() (object *AWS, err error) {
return
}
}
object.hcpInternalCommunicationHostedZoneId = b.hcpInternalCommunicationHostedZoneId
object.privateHostedZoneID = b.privateHostedZoneID
object.privateHostedZoneRoleARN = b.privateHostedZoneRoleARN
object.privateLink = b.privateLink
Expand All @@ -362,5 +381,6 @@ func (b *AWSBuilder) Build() (object *AWS, err error) {
object.tags[k] = v
}
}
object.vpcEndpointRoleArn = b.vpcEndpointRoleArn
return
}
76 changes: 62 additions & 14 deletions clustersmgmt/v1/aws_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,14 @@ type AWS struct {
billingAccountID string
ec2MetadataHttpTokens Ec2MetadataHttpTokens
etcdEncryption *AwsEtcdEncryption
hcpInternalCommunicationHostedZoneId string
privateHostedZoneID string
privateHostedZoneRoleARN string
privateLinkConfiguration *PrivateLinkClusterConfiguration
secretAccessKey string
subnetIDs []string
tags map[string]string
vpcEndpointRoleArn string
privateLink bool
}

Expand Down Expand Up @@ -326,12 +328,35 @@ func (o *AWS) GetEtcdEncryption() (value *AwsEtcdEncryption, ok bool) {
return
}

// HcpInternalCommunicationHostedZoneId returns the value of the 'hcp_internal_communication_hosted_zone_id' attribute, or
// the zero value of the type if the attribute doesn't have a value.
//
// ID of local private hosted zone for hypershift internal communication.
func (o *AWS) HcpInternalCommunicationHostedZoneId() string {
if o != nil && o.bitmap_&4096 != 0 {
return o.hcpInternalCommunicationHostedZoneId
}
return ""
}

// GetHcpInternalCommunicationHostedZoneId returns the value of the 'hcp_internal_communication_hosted_zone_id' attribute and
// a flag indicating if the attribute has a value.
//
// ID of local private hosted zone for hypershift internal communication.
func (o *AWS) GetHcpInternalCommunicationHostedZoneId() (value string, ok bool) {
ok = o != nil && o.bitmap_&4096 != 0
if ok {
value = o.hcpInternalCommunicationHostedZoneId
}
return
}

// PrivateHostedZoneID returns the value of the 'private_hosted_zone_ID' attribute, or
// the zero value of the type if the attribute doesn't have a value.
//
// ID of private hosted zone.
func (o *AWS) PrivateHostedZoneID() string {
if o != nil && o.bitmap_&4096 != 0 {
if o != nil && o.bitmap_&8192 != 0 {
return o.privateHostedZoneID
}
return ""
Expand All @@ -342,7 +367,7 @@ func (o *AWS) PrivateHostedZoneID() string {
//
// ID of private hosted zone.
func (o *AWS) GetPrivateHostedZoneID() (value string, ok bool) {
ok = o != nil && o.bitmap_&4096 != 0
ok = o != nil && o.bitmap_&8192 != 0
if ok {
value = o.privateHostedZoneID
}
Expand All @@ -354,7 +379,7 @@ func (o *AWS) GetPrivateHostedZoneID() (value string, ok bool) {
//
// Role ARN for private hosted zone.
func (o *AWS) PrivateHostedZoneRoleARN() string {
if o != nil && o.bitmap_&8192 != 0 {
if o != nil && o.bitmap_&16384 != 0 {
return o.privateHostedZoneRoleARN
}
return ""
Expand All @@ -365,7 +390,7 @@ func (o *AWS) PrivateHostedZoneRoleARN() string {
//
// Role ARN for private hosted zone.
func (o *AWS) GetPrivateHostedZoneRoleARN() (value string, ok bool) {
ok = o != nil && o.bitmap_&8192 != 0
ok = o != nil && o.bitmap_&16384 != 0
if ok {
value = o.privateHostedZoneRoleARN
}
Expand All @@ -377,7 +402,7 @@ func (o *AWS) GetPrivateHostedZoneRoleARN() (value string, ok bool) {
//
// Sets cluster to be inaccessible externally.
func (o *AWS) PrivateLink() bool {
if o != nil && o.bitmap_&16384 != 0 {
if o != nil && o.bitmap_&32768 != 0 {
return o.privateLink
}
return false
Expand All @@ -388,7 +413,7 @@ func (o *AWS) PrivateLink() bool {
//
// Sets cluster to be inaccessible externally.
func (o *AWS) GetPrivateLink() (value bool, ok bool) {
ok = o != nil && o.bitmap_&16384 != 0
ok = o != nil && o.bitmap_&32768 != 0
if ok {
value = o.privateLink
}
Expand All @@ -400,7 +425,7 @@ func (o *AWS) GetPrivateLink() (value bool, ok bool) {
//
// Manages additional configuration for Private Links.
func (o *AWS) PrivateLinkConfiguration() *PrivateLinkClusterConfiguration {
if o != nil && o.bitmap_&32768 != 0 {
if o != nil && o.bitmap_&65536 != 0 {
return o.privateLinkConfiguration
}
return nil
Expand All @@ -411,7 +436,7 @@ func (o *AWS) PrivateLinkConfiguration() *PrivateLinkClusterConfiguration {
//
// Manages additional configuration for Private Links.
func (o *AWS) GetPrivateLinkConfiguration() (value *PrivateLinkClusterConfiguration, ok bool) {
ok = o != nil && o.bitmap_&32768 != 0
ok = o != nil && o.bitmap_&65536 != 0
if ok {
value = o.privateLinkConfiguration
}
Expand All @@ -423,7 +448,7 @@ func (o *AWS) GetPrivateLinkConfiguration() (value *PrivateLinkClusterConfigurat
//
// AWS secret access key.
func (o *AWS) SecretAccessKey() string {
if o != nil && o.bitmap_&65536 != 0 {
if o != nil && o.bitmap_&131072 != 0 {
return o.secretAccessKey
}
return ""
Expand All @@ -434,7 +459,7 @@ func (o *AWS) SecretAccessKey() string {
//
// AWS secret access key.
func (o *AWS) GetSecretAccessKey() (value string, ok bool) {
ok = o != nil && o.bitmap_&65536 != 0
ok = o != nil && o.bitmap_&131072 != 0
if ok {
value = o.secretAccessKey
}
Expand All @@ -446,7 +471,7 @@ func (o *AWS) GetSecretAccessKey() (value string, ok bool) {
//
// The subnet ids to be used when installing the cluster.
func (o *AWS) SubnetIDs() []string {
if o != nil && o.bitmap_&131072 != 0 {
if o != nil && o.bitmap_&262144 != 0 {
return o.subnetIDs
}
return nil
Expand All @@ -457,7 +482,7 @@ func (o *AWS) SubnetIDs() []string {
//
// The subnet ids to be used when installing the cluster.
func (o *AWS) GetSubnetIDs() (value []string, ok bool) {
ok = o != nil && o.bitmap_&131072 != 0
ok = o != nil && o.bitmap_&262144 != 0
if ok {
value = o.subnetIDs
}
Expand All @@ -469,7 +494,7 @@ func (o *AWS) GetSubnetIDs() (value []string, ok bool) {
//
// Optional keys and values that the installer will add as tags to all AWS resources it creates
func (o *AWS) Tags() map[string]string {
if o != nil && o.bitmap_&262144 != 0 {
if o != nil && o.bitmap_&524288 != 0 {
return o.tags
}
return nil
Expand All @@ -480,13 +505,36 @@ func (o *AWS) Tags() map[string]string {
//
// Optional keys and values that the installer will add as tags to all AWS resources it creates
func (o *AWS) GetTags() (value map[string]string, ok bool) {
ok = o != nil && o.bitmap_&262144 != 0
ok = o != nil && o.bitmap_&524288 != 0
if ok {
value = o.tags
}
return
}

// VpcEndpointRoleArn returns the value of the 'vpc_endpoint_role_arn' attribute, or
// the zero value of the type if the attribute doesn't have a value.
//
// Role ARN for VPC Endpoint Service cross account role.
func (o *AWS) VpcEndpointRoleArn() string {
if o != nil && o.bitmap_&1048576 != 0 {
return o.vpcEndpointRoleArn
}
return ""
}

// GetVpcEndpointRoleArn returns the value of the 'vpc_endpoint_role_arn' attribute and
// a flag indicating if the attribute has a value.
//
// Role ARN for VPC Endpoint Service cross account role.
func (o *AWS) GetVpcEndpointRoleArn() (value string, ok bool) {
ok = o != nil && o.bitmap_&1048576 != 0
if ok {
value = o.vpcEndpointRoleArn
}
return
}

// AWSListKind is the name of the type used to represent list of objects of
// type 'AWS'.
const AWSListKind = "AWSList"
Expand Down
Loading
Loading