Skip to content

Commit

Permalink
chore: bump to ocm-api-model 0.0.391
Browse files Browse the repository at this point in the history
  • Loading branch information
andreadecorte committed Aug 28, 2024
1 parent 97699ae commit 832ca94
Show file tree
Hide file tree
Showing 62 changed files with 29,986 additions and 20,489 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.390
model_version:=v0.0.391
model_url:=https://github.com/openshift-online/ocm-api-model.git

# Details of the metamodel to use:
Expand Down
59 changes: 50 additions & 9 deletions clustersmgmt/v1/cluster_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ type ClusterBuilder struct {
provisionShard *ProvisionShardBuilder
proxy *ProxyBuilder
region *CloudRegionBuilder
registryConfig *ClusterRegistryConfigBuilder
state ClusterState
status *ClusterStatusBuilder
storageQuota *ValueBuilder
Expand Down Expand Up @@ -716,12 +717,41 @@ func (b *ClusterBuilder) Region(value *CloudRegionBuilder) *ClusterBuilder {
return b
}

// RegistryConfig sets the value of the 'registry_config' attribute to the given value.
//
// ClusterRegistryConfig describes the configuration of registries for the cluster.
// Its format reflects the OpenShift Image Configuration, for which docs are available on
// [docs.openshift.com](https://docs.openshift.com/container-platform/4.16/openshift_images/image-configuration.html)
// ```json
//
// {
// "registry_config": {
// "registry_sources": {
// "blocked_registries": [
// "badregistry.io",
// "badregistry8.io"
// ]
// }
// }
// }
//
// ```
func (b *ClusterBuilder) RegistryConfig(value *ClusterRegistryConfigBuilder) *ClusterBuilder {
b.registryConfig = value
if value != nil {
b.bitmap_ |= 72057594037927936
} else {
b.bitmap_ &^= 72057594037927936
}
return b
}

// State sets the value of the 'state' attribute to the given value.
//
// Overall state of a cluster.
func (b *ClusterBuilder) State(value ClusterState) *ClusterBuilder {
b.state = value
b.bitmap_ |= 72057594037927936
b.bitmap_ |= 144115188075855872
return b
}

Expand All @@ -731,9 +761,9 @@ func (b *ClusterBuilder) State(value ClusterState) *ClusterBuilder {
func (b *ClusterBuilder) Status(value *ClusterStatusBuilder) *ClusterBuilder {
b.status = value
if value != nil {
b.bitmap_ |= 144115188075855872
b.bitmap_ |= 288230376151711744
} else {
b.bitmap_ &^= 144115188075855872
b.bitmap_ &^= 288230376151711744
}
return b
}
Expand Down Expand Up @@ -761,9 +791,9 @@ func (b *ClusterBuilder) Status(value *ClusterStatusBuilder) *ClusterBuilder {
func (b *ClusterBuilder) StorageQuota(value *ValueBuilder) *ClusterBuilder {
b.storageQuota = value
if value != nil {
b.bitmap_ |= 288230376151711744
b.bitmap_ |= 576460752303423488
} else {
b.bitmap_ &^= 288230376151711744
b.bitmap_ &^= 576460752303423488
}
return b
}
Expand All @@ -774,9 +804,9 @@ func (b *ClusterBuilder) StorageQuota(value *ValueBuilder) *ClusterBuilder {
func (b *ClusterBuilder) Subscription(value *SubscriptionBuilder) *ClusterBuilder {
b.subscription = value
if value != nil {
b.bitmap_ |= 576460752303423488
b.bitmap_ |= 1152921504606846976
} else {
b.bitmap_ &^= 576460752303423488
b.bitmap_ &^= 1152921504606846976
}
return b
}
Expand All @@ -787,9 +817,9 @@ func (b *ClusterBuilder) Subscription(value *SubscriptionBuilder) *ClusterBuilde
func (b *ClusterBuilder) Version(value *VersionBuilder) *ClusterBuilder {
b.version = value
if value != nil {
b.bitmap_ |= 1152921504606846976
b.bitmap_ |= 2305843009213693952
} else {
b.bitmap_ &^= 1152921504606846976
b.bitmap_ &^= 2305843009213693952
}
return b
}
Expand Down Expand Up @@ -1002,6 +1032,11 @@ func (b *ClusterBuilder) Copy(object *Cluster) *ClusterBuilder {
} else {
b.region = nil
}
if object.registryConfig != nil {
b.registryConfig = NewClusterRegistryConfig().Copy(object.registryConfig)
} else {
b.registryConfig = nil
}
b.state = object.state
if object.status != nil {
b.status = NewClusterStatus().Copy(object.status)
Expand Down Expand Up @@ -1265,6 +1300,12 @@ func (b *ClusterBuilder) Build() (object *Cluster, err error) {
return
}
}
if b.registryConfig != nil {
object.registryConfig, err = b.registryConfig.Build()
if err != nil {
return
}
}
object.state = b.state
if b.status != nil {
object.status, err = b.status.Build()
Expand Down
173 changes: 173 additions & 0 deletions clustersmgmt/v1/cluster_registry_config_builder.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
/*
Copyright (c) 2020 Red Hat, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

// IMPORTANT: This file has been generated automatically, refrain from modifying it manually as all
// your changes will be lost when the file is generated again.

package v1 // github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1

// ClusterRegistryConfigBuilder contains the data and logic needed to build 'cluster_registry_config' objects.
//
// ClusterRegistryConfig describes the configuration of registries for the cluster.
// Its format reflects the OpenShift Image Configuration, for which docs are available on
// [docs.openshift.com](https://docs.openshift.com/container-platform/4.16/openshift_images/image-configuration.html)
// ```json
//
// {
// "registry_config": {
// "registry_sources": {
// "blocked_registries": [
// "badregistry.io",
// "badregistry8.io"
// ]
// }
// }
// }
//
// ```
type ClusterRegistryConfigBuilder struct {
bitmap_ uint32
additionalTrustedCa map[string]string
allowedRegistriesForImport []*RegistryLocationBuilder
platformAllowlist *RegistryAllowlistBuilder
registrySources *RegistrySourcesBuilder
}

// NewClusterRegistryConfig creates a new builder of 'cluster_registry_config' objects.
func NewClusterRegistryConfig() *ClusterRegistryConfigBuilder {
return &ClusterRegistryConfigBuilder{}
}

// Empty returns true if the builder is empty, i.e. no attribute has a value.
func (b *ClusterRegistryConfigBuilder) Empty() bool {
return b == nil || b.bitmap_ == 0
}

// AdditionalTrustedCa sets the value of the 'additional_trusted_ca' attribute to the given value.
func (b *ClusterRegistryConfigBuilder) AdditionalTrustedCa(value map[string]string) *ClusterRegistryConfigBuilder {
b.additionalTrustedCa = value
if value != nil {
b.bitmap_ |= 1
} else {
b.bitmap_ &^= 1
}
return b
}

// AllowedRegistriesForImport sets the value of the 'allowed_registries_for_import' attribute to the given values.
func (b *ClusterRegistryConfigBuilder) AllowedRegistriesForImport(values ...*RegistryLocationBuilder) *ClusterRegistryConfigBuilder {
b.allowedRegistriesForImport = make([]*RegistryLocationBuilder, len(values))
copy(b.allowedRegistriesForImport, values)
b.bitmap_ |= 2
return b
}

// PlatformAllowlist sets the value of the 'platform_allowlist' attribute to the given value.
//
// RegistryAllowlist represents a single registry allowlist.
func (b *ClusterRegistryConfigBuilder) PlatformAllowlist(value *RegistryAllowlistBuilder) *ClusterRegistryConfigBuilder {
b.platformAllowlist = value
if value != nil {
b.bitmap_ |= 4
} else {
b.bitmap_ &^= 4
}
return b
}

// RegistrySources sets the value of the 'registry_sources' attribute to the given value.
//
// RegistrySources contains configuration that determines how the container runtime should treat individual
// registries when accessing images for builds and pods. For instance, whether or not to allow insecure access.
// It does not contain configuration for the internal cluster registry.
func (b *ClusterRegistryConfigBuilder) RegistrySources(value *RegistrySourcesBuilder) *ClusterRegistryConfigBuilder {
b.registrySources = value
if value != nil {
b.bitmap_ |= 8
} else {
b.bitmap_ &^= 8
}
return b
}

// Copy copies the attributes of the given object into this builder, discarding any previous values.
func (b *ClusterRegistryConfigBuilder) Copy(object *ClusterRegistryConfig) *ClusterRegistryConfigBuilder {
if object == nil {
return b
}
b.bitmap_ = object.bitmap_
if len(object.additionalTrustedCa) > 0 {
b.additionalTrustedCa = map[string]string{}
for k, v := range object.additionalTrustedCa {
b.additionalTrustedCa[k] = v
}
} else {
b.additionalTrustedCa = nil
}
if object.allowedRegistriesForImport != nil {
b.allowedRegistriesForImport = make([]*RegistryLocationBuilder, len(object.allowedRegistriesForImport))
for i, v := range object.allowedRegistriesForImport {
b.allowedRegistriesForImport[i] = NewRegistryLocation().Copy(v)
}
} else {
b.allowedRegistriesForImport = nil
}
if object.platformAllowlist != nil {
b.platformAllowlist = NewRegistryAllowlist().Copy(object.platformAllowlist)
} else {
b.platformAllowlist = nil
}
if object.registrySources != nil {
b.registrySources = NewRegistrySources().Copy(object.registrySources)
} else {
b.registrySources = nil
}
return b
}

// Build creates a 'cluster_registry_config' object using the configuration stored in the builder.
func (b *ClusterRegistryConfigBuilder) Build() (object *ClusterRegistryConfig, err error) {
object = new(ClusterRegistryConfig)
object.bitmap_ = b.bitmap_
if b.additionalTrustedCa != nil {
object.additionalTrustedCa = make(map[string]string)
for k, v := range b.additionalTrustedCa {
object.additionalTrustedCa[k] = v
}
}
if b.allowedRegistriesForImport != nil {
object.allowedRegistriesForImport = make([]*RegistryLocation, len(b.allowedRegistriesForImport))
for i, v := range b.allowedRegistriesForImport {
object.allowedRegistriesForImport[i], err = v.Build()
if err != nil {
return
}
}
}
if b.platformAllowlist != nil {
object.platformAllowlist, err = b.platformAllowlist.Build()
if err != nil {
return
}
}
if b.registrySources != nil {
object.registrySources, err = b.registrySources.Build()
if err != nil {
return
}
}
return
}
71 changes: 71 additions & 0 deletions clustersmgmt/v1/cluster_registry_config_list_builder.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/*
Copyright (c) 2020 Red Hat, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

// IMPORTANT: This file has been generated automatically, refrain from modifying it manually as all
// your changes will be lost when the file is generated again.

package v1 // github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1

// ClusterRegistryConfigListBuilder contains the data and logic needed to build
// 'cluster_registry_config' objects.
type ClusterRegistryConfigListBuilder struct {
items []*ClusterRegistryConfigBuilder
}

// NewClusterRegistryConfigList creates a new builder of 'cluster_registry_config' objects.
func NewClusterRegistryConfigList() *ClusterRegistryConfigListBuilder {
return new(ClusterRegistryConfigListBuilder)
}

// Items sets the items of the list.
func (b *ClusterRegistryConfigListBuilder) Items(values ...*ClusterRegistryConfigBuilder) *ClusterRegistryConfigListBuilder {
b.items = make([]*ClusterRegistryConfigBuilder, len(values))
copy(b.items, values)
return b
}

// Empty returns true if the list is empty.
func (b *ClusterRegistryConfigListBuilder) Empty() bool {
return b == nil || len(b.items) == 0
}

// Copy copies the items of the given list into this builder, discarding any previous items.
func (b *ClusterRegistryConfigListBuilder) Copy(list *ClusterRegistryConfigList) *ClusterRegistryConfigListBuilder {
if list == nil || list.items == nil {
b.items = nil
} else {
b.items = make([]*ClusterRegistryConfigBuilder, len(list.items))
for i, v := range list.items {
b.items[i] = NewClusterRegistryConfig().Copy(v)
}
}
return b
}

// Build creates a list of 'cluster_registry_config' objects using the
// configuration stored in the builder.
func (b *ClusterRegistryConfigListBuilder) Build() (list *ClusterRegistryConfigList, err error) {
items := make([]*ClusterRegistryConfig, len(b.items))
for i, item := range b.items {
items[i], err = item.Build()
if err != nil {
return
}
}
list = new(ClusterRegistryConfigList)
list.items = items
return
}
Loading

0 comments on commit 832ca94

Please sign in to comment.