Skip to content

Commit

Permalink
Merge pull request #672 from tzvatot/provision-shards
Browse files Browse the repository at this point in the history
Bump OCM API model version: Add kubeconfig as well as server URL to provision shard
  • Loading branch information
tzvatot authored Aug 16, 2022
2 parents 7dae39f + b0c7132 commit 54ef4de
Show file tree
Hide file tree
Showing 13 changed files with 1,831 additions and 1,047 deletions.
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.284
- Update to model 0.0.218:
- Change provision shard to include kube client configurations and server URL.

## 0.1.283
- Update to model 0.0.217:
- Change provision shard to include kube client configurations.
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
export CGO_ENABLED=0

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

# Details of the metamodel to use:
Expand Down
2,009 changes: 1,032 additions & 977 deletions clustersmgmt/v1/openapi.go

Large diffs are not rendered by default.

100 changes: 76 additions & 24 deletions clustersmgmt/v1/provision_shard_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ type ProvisionShardBuilder struct {
bitmap_ uint32
id string
href string
awsAccountOperatorConfig string
awsAccountOperatorConfig *ServerConfigBuilder
awsBaseDomain string
gcpBaseDomain string
gcpProjectOperator string
gcpProjectOperator *ServerConfigBuilder
cloudProvider *CloudProviderBuilder
hiveConfig string
hypershiftConfig string
hiveConfig *ServerConfigBuilder
hypershiftConfig *ServerConfigBuilder
managementCluster string
region *CloudRegionBuilder
status string
Expand Down Expand Up @@ -70,10 +70,14 @@ func (b *ProvisionShardBuilder) Empty() bool {

// AWSAccountOperatorConfig sets the value of the 'AWS_account_operator_config' attribute to the given value.
//
//
func (b *ProvisionShardBuilder) AWSAccountOperatorConfig(value string) *ProvisionShardBuilder {
// Representation of a server config
func (b *ProvisionShardBuilder) AWSAccountOperatorConfig(value *ServerConfigBuilder) *ProvisionShardBuilder {
b.awsAccountOperatorConfig = value
b.bitmap_ |= 8
if value != nil {
b.bitmap_ |= 8
} else {
b.bitmap_ &^= 8
}
return b
}

Expand All @@ -97,10 +101,14 @@ func (b *ProvisionShardBuilder) GCPBaseDomain(value string) *ProvisionShardBuild

// GCPProjectOperator sets the value of the 'GCP_project_operator' attribute to the given value.
//
//
func (b *ProvisionShardBuilder) GCPProjectOperator(value string) *ProvisionShardBuilder {
// Representation of a server config
func (b *ProvisionShardBuilder) GCPProjectOperator(value *ServerConfigBuilder) *ProvisionShardBuilder {
b.gcpProjectOperator = value
b.bitmap_ |= 64
if value != nil {
b.bitmap_ |= 64
} else {
b.bitmap_ &^= 64
}
return b
}

Expand All @@ -119,19 +127,27 @@ func (b *ProvisionShardBuilder) CloudProvider(value *CloudProviderBuilder) *Prov

// HiveConfig sets the value of the 'hive_config' attribute to the given value.
//
//
func (b *ProvisionShardBuilder) HiveConfig(value string) *ProvisionShardBuilder {
// Representation of a server config
func (b *ProvisionShardBuilder) HiveConfig(value *ServerConfigBuilder) *ProvisionShardBuilder {
b.hiveConfig = value
b.bitmap_ |= 256
if value != nil {
b.bitmap_ |= 256
} else {
b.bitmap_ &^= 256
}
return b
}

// HypershiftConfig sets the value of the 'hypershift_config' attribute to the given value.
//
//
func (b *ProvisionShardBuilder) HypershiftConfig(value string) *ProvisionShardBuilder {
// Representation of a server config
func (b *ProvisionShardBuilder) HypershiftConfig(value *ServerConfigBuilder) *ProvisionShardBuilder {
b.hypershiftConfig = value
b.bitmap_ |= 512
if value != nil {
b.bitmap_ |= 512
} else {
b.bitmap_ &^= 512
}
return b
}

Expand Down Expand Up @@ -174,17 +190,33 @@ func (b *ProvisionShardBuilder) Copy(object *ProvisionShard) *ProvisionShardBuil
b.bitmap_ = object.bitmap_
b.id = object.id
b.href = object.href
b.awsAccountOperatorConfig = object.awsAccountOperatorConfig
if object.awsAccountOperatorConfig != nil {
b.awsAccountOperatorConfig = NewServerConfig().Copy(object.awsAccountOperatorConfig)
} else {
b.awsAccountOperatorConfig = nil
}
b.awsBaseDomain = object.awsBaseDomain
b.gcpBaseDomain = object.gcpBaseDomain
b.gcpProjectOperator = object.gcpProjectOperator
if object.gcpProjectOperator != nil {
b.gcpProjectOperator = NewServerConfig().Copy(object.gcpProjectOperator)
} else {
b.gcpProjectOperator = nil
}
if object.cloudProvider != nil {
b.cloudProvider = NewCloudProvider().Copy(object.cloudProvider)
} else {
b.cloudProvider = nil
}
b.hiveConfig = object.hiveConfig
b.hypershiftConfig = object.hypershiftConfig
if object.hiveConfig != nil {
b.hiveConfig = NewServerConfig().Copy(object.hiveConfig)
} else {
b.hiveConfig = nil
}
if object.hypershiftConfig != nil {
b.hypershiftConfig = NewServerConfig().Copy(object.hypershiftConfig)
} else {
b.hypershiftConfig = nil
}
b.managementCluster = object.managementCluster
if object.region != nil {
b.region = NewCloudRegion().Copy(object.region)
Expand All @@ -201,18 +233,38 @@ func (b *ProvisionShardBuilder) Build() (object *ProvisionShard, err error) {
object.id = b.id
object.href = b.href
object.bitmap_ = b.bitmap_
object.awsAccountOperatorConfig = b.awsAccountOperatorConfig
if b.awsAccountOperatorConfig != nil {
object.awsAccountOperatorConfig, err = b.awsAccountOperatorConfig.Build()
if err != nil {
return
}
}
object.awsBaseDomain = b.awsBaseDomain
object.gcpBaseDomain = b.gcpBaseDomain
object.gcpProjectOperator = b.gcpProjectOperator
if b.gcpProjectOperator != nil {
object.gcpProjectOperator, err = b.gcpProjectOperator.Build()
if err != nil {
return
}
}
if b.cloudProvider != nil {
object.cloudProvider, err = b.cloudProvider.Build()
if err != nil {
return
}
}
object.hiveConfig = b.hiveConfig
object.hypershiftConfig = b.hypershiftConfig
if b.hiveConfig != nil {
object.hiveConfig, err = b.hiveConfig.Build()
if err != nil {
return
}
}
if b.hypershiftConfig != nil {
object.hypershiftConfig, err = b.hypershiftConfig.Build()
if err != nil {
return
}
}
object.managementCluster = b.managementCluster
if b.region != nil {
object.region, err = b.region.Build()
Expand Down
48 changes: 24 additions & 24 deletions clustersmgmt/v1/provision_shard_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ type ProvisionShard struct {
bitmap_ uint32
id string
href string
awsAccountOperatorConfig string
awsAccountOperatorConfig *ServerConfig
awsBaseDomain string
gcpBaseDomain string
gcpProjectOperator string
gcpProjectOperator *ServerConfig
cloudProvider *CloudProvider
hiveConfig string
hypershiftConfig string
hiveConfig *ServerConfig
hypershiftConfig *ServerConfig
managementCluster string
region *CloudRegion
status string
Expand Down Expand Up @@ -110,19 +110,19 @@ func (o *ProvisionShard) Empty() bool {
// AWSAccountOperatorConfig returns the value of the 'AWS_account_operator_config' attribute, or
// the zero value of the type if the attribute doesn't have a value.
//
// Contains the kube client configuration for the AWS account operator.
func (o *ProvisionShard) AWSAccountOperatorConfig() string {
// Contains the configuration for the AWS account operator.
func (o *ProvisionShard) AWSAccountOperatorConfig() *ServerConfig {
if o != nil && o.bitmap_&8 != 0 {
return o.awsAccountOperatorConfig
}
return ""
return nil
}

// GetAWSAccountOperatorConfig returns the value of the 'AWS_account_operator_config' attribute and
// a flag indicating if the attribute has a value.
//
// Contains the kube client configuration for the AWS account operator.
func (o *ProvisionShard) GetAWSAccountOperatorConfig() (value string, ok bool) {
// Contains the configuration for the AWS account operator.
func (o *ProvisionShard) GetAWSAccountOperatorConfig() (value *ServerConfig, ok bool) {
ok = o != nil && o.bitmap_&8 != 0
if ok {
value = o.awsAccountOperatorConfig
Expand Down Expand Up @@ -179,19 +179,19 @@ func (o *ProvisionShard) GetGCPBaseDomain() (value string, ok bool) {
// GCPProjectOperator returns the value of the 'GCP_project_operator' attribute, or
// the zero value of the type if the attribute doesn't have a value.
//
// Contains the kube client configuration for the GCP project operator.
func (o *ProvisionShard) GCPProjectOperator() string {
// Contains the configuration for the GCP project operator.
func (o *ProvisionShard) GCPProjectOperator() *ServerConfig {
if o != nil && o.bitmap_&64 != 0 {
return o.gcpProjectOperator
}
return ""
return nil
}

// GetGCPProjectOperator returns the value of the 'GCP_project_operator' attribute and
// a flag indicating if the attribute has a value.
//
// Contains the kube client configuration for the GCP project operator.
func (o *ProvisionShard) GetGCPProjectOperator() (value string, ok bool) {
// Contains the configuration for the GCP project operator.
func (o *ProvisionShard) GetGCPProjectOperator() (value *ServerConfig, ok bool) {
ok = o != nil && o.bitmap_&64 != 0
if ok {
value = o.gcpProjectOperator
Expand Down Expand Up @@ -225,19 +225,19 @@ func (o *ProvisionShard) GetCloudProvider() (value *CloudProvider, ok bool) {
// HiveConfig returns the value of the 'hive_config' attribute, or
// the zero value of the type if the attribute doesn't have a value.
//
// Contains the kube client configuration for Hive.
func (o *ProvisionShard) HiveConfig() string {
// Contains the configuration for Hive.
func (o *ProvisionShard) HiveConfig() *ServerConfig {
if o != nil && o.bitmap_&256 != 0 {
return o.hiveConfig
}
return ""
return nil
}

// GetHiveConfig returns the value of the 'hive_config' attribute and
// a flag indicating if the attribute has a value.
//
// Contains the kube client configuration for Hive.
func (o *ProvisionShard) GetHiveConfig() (value string, ok bool) {
// Contains the configuration for Hive.
func (o *ProvisionShard) GetHiveConfig() (value *ServerConfig, ok bool) {
ok = o != nil && o.bitmap_&256 != 0
if ok {
value = o.hiveConfig
Expand All @@ -248,19 +248,19 @@ func (o *ProvisionShard) GetHiveConfig() (value string, ok bool) {
// HypershiftConfig returns the value of the 'hypershift_config' attribute, or
// the zero value of the type if the attribute doesn't have a value.
//
// Contains the kube client configuration for Hypershift.
func (o *ProvisionShard) HypershiftConfig() string {
// Contains the configuration for Hypershift.
func (o *ProvisionShard) HypershiftConfig() *ServerConfig {
if o != nil && o.bitmap_&512 != 0 {
return o.hypershiftConfig
}
return ""
return nil
}

// GetHypershiftConfig returns the value of the 'hypershift_config' attribute and
// a flag indicating if the attribute has a value.
//
// Contains the kube client configuration for Hypershift.
func (o *ProvisionShard) GetHypershiftConfig() (value string, ok bool) {
// Contains the configuration for Hypershift.
func (o *ProvisionShard) GetHypershiftConfig() (value *ServerConfig, ok bool) {
ok = o != nil && o.bitmap_&512 != 0
if ok {
value = o.hypershiftConfig
Expand Down
24 changes: 12 additions & 12 deletions clustersmgmt/v1/provision_shard_type_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ func writeProvisionShard(object *ProvisionShard, stream *jsoniter.Stream) {
count++
}
var present_ bool
present_ = object.bitmap_&8 != 0
present_ = object.bitmap_&8 != 0 && object.awsAccountOperatorConfig != nil
if present_ {
if count > 0 {
stream.WriteMore()
}
stream.WriteObjectField("aws_account_operator_config")
stream.WriteString(object.awsAccountOperatorConfig)
writeServerConfig(object.awsAccountOperatorConfig, stream)
count++
}
present_ = object.bitmap_&16 != 0
Expand All @@ -92,13 +92,13 @@ func writeProvisionShard(object *ProvisionShard, stream *jsoniter.Stream) {
stream.WriteString(object.gcpBaseDomain)
count++
}
present_ = object.bitmap_&64 != 0
present_ = object.bitmap_&64 != 0 && object.gcpProjectOperator != nil
if present_ {
if count > 0 {
stream.WriteMore()
}
stream.WriteObjectField("gcp_project_operator")
stream.WriteString(object.gcpProjectOperator)
writeServerConfig(object.gcpProjectOperator, stream)
count++
}
present_ = object.bitmap_&128 != 0 && object.cloudProvider != nil
Expand All @@ -110,22 +110,22 @@ func writeProvisionShard(object *ProvisionShard, stream *jsoniter.Stream) {
writeCloudProvider(object.cloudProvider, stream)
count++
}
present_ = object.bitmap_&256 != 0
present_ = object.bitmap_&256 != 0 && object.hiveConfig != nil
if present_ {
if count > 0 {
stream.WriteMore()
}
stream.WriteObjectField("hive_config")
stream.WriteString(object.hiveConfig)
writeServerConfig(object.hiveConfig, stream)
count++
}
present_ = object.bitmap_&512 != 0
present_ = object.bitmap_&512 != 0 && object.hypershiftConfig != nil
if present_ {
if count > 0 {
stream.WriteMore()
}
stream.WriteObjectField("hypershift_config")
stream.WriteString(object.hypershiftConfig)
writeServerConfig(object.hypershiftConfig, stream)
count++
}
present_ = object.bitmap_&1024 != 0
Expand Down Expand Up @@ -190,7 +190,7 @@ func readProvisionShard(iterator *jsoniter.Iterator) *ProvisionShard {
object.href = iterator.ReadString()
object.bitmap_ |= 4
case "aws_account_operator_config":
value := iterator.ReadString()
value := readServerConfig(iterator)
object.awsAccountOperatorConfig = value
object.bitmap_ |= 8
case "aws_base_domain":
Expand All @@ -202,19 +202,19 @@ func readProvisionShard(iterator *jsoniter.Iterator) *ProvisionShard {
object.gcpBaseDomain = value
object.bitmap_ |= 32
case "gcp_project_operator":
value := iterator.ReadString()
value := readServerConfig(iterator)
object.gcpProjectOperator = value
object.bitmap_ |= 64
case "cloud_provider":
value := readCloudProvider(iterator)
object.cloudProvider = value
object.bitmap_ |= 128
case "hive_config":
value := iterator.ReadString()
value := readServerConfig(iterator)
object.hiveConfig = value
object.bitmap_ |= 256
case "hypershift_config":
value := iterator.ReadString()
value := readServerConfig(iterator)
object.hypershiftConfig = value
object.bitmap_ |= 512
case "management_cluster":
Expand Down
Loading

0 comments on commit 54ef4de

Please sign in to comment.