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-1863 | feat : Prepare v0.1.409 release #925

Merged
merged 2 commits into from
Mar 7, 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
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
This document describes the relevant changes between releases of the OCM API
SDK.

## 0.1.409
- Update model version v0.0.363
- Add `NodeDrainGracePeriod` to the `NodePool` model.
- Update model version v0.0.362
- Changed `UserName` attribute for TokenClaimMappings to `Username`.

## 0.1.408
- Update model version v0.0.361
- Add `Scope` attribute to `ReservedResource`.
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.361
model_version:=v0.0.363
model_url:=https://github.com/openshift-online/ocm-api-model.git

# Details of the metamodel to use:
Expand Down
86 changes: 64 additions & 22 deletions clustersmgmt/v1/node_pool_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,21 @@ package v1 // github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1
//
// Representation of a node pool in a cluster.
type NodePoolBuilder struct {
bitmap_ uint32
id string
href string
awsNodePool *AWSNodePoolBuilder
autoscaling *NodePoolAutoscalingBuilder
availabilityZone string
labels map[string]string
replicas int
status *NodePoolStatusBuilder
subnet string
taints []*TaintBuilder
tuningConfigs []string
version *VersionBuilder
autoRepair bool
bitmap_ uint32
id string
href string
awsNodePool *AWSNodePoolBuilder
autoscaling *NodePoolAutoscalingBuilder
availabilityZone string
labels map[string]string
nodeDrainGracePeriod *ValueBuilder
replicas int
status *NodePoolStatusBuilder
subnet string
taints []*TaintBuilder
tuningConfigs []string
version *VersionBuilder
autoRepair bool
}

// NewNodePool creates a new builder of 'node_pool' objects.
Expand Down Expand Up @@ -120,10 +121,40 @@ func (b *NodePoolBuilder) Labels(value map[string]string) *NodePoolBuilder {
return b
}

// NodeDrainGracePeriod sets the value of the 'node_drain_grace_period' attribute to the given value.
//
// Numeric value and the unit used to measure it.
//
// Units are not mandatory, and they're not specified for some resources. For
// resources that use bytes, the accepted units are:
//
// - 1 B = 1 byte
// - 1 KB = 10^3 bytes
// - 1 MB = 10^6 bytes
// - 1 GB = 10^9 bytes
// - 1 TB = 10^12 bytes
// - 1 PB = 10^15 bytes
//
// - 1 B = 1 byte
// - 1 KiB = 2^10 bytes
// - 1 MiB = 2^20 bytes
// - 1 GiB = 2^30 bytes
// - 1 TiB = 2^40 bytes
// - 1 PiB = 2^50 bytes
func (b *NodePoolBuilder) NodeDrainGracePeriod(value *ValueBuilder) *NodePoolBuilder {
b.nodeDrainGracePeriod = value
if value != nil {
b.bitmap_ |= 256
} else {
b.bitmap_ &^= 256
}
return b
}

// Replicas sets the value of the 'replicas' attribute to the given value.
func (b *NodePoolBuilder) Replicas(value int) *NodePoolBuilder {
b.replicas = value
b.bitmap_ |= 256
b.bitmap_ |= 512
return b
}

Expand All @@ -133,33 +164,33 @@ func (b *NodePoolBuilder) Replicas(value int) *NodePoolBuilder {
func (b *NodePoolBuilder) Status(value *NodePoolStatusBuilder) *NodePoolBuilder {
b.status = value
if value != nil {
b.bitmap_ |= 512
b.bitmap_ |= 1024
} else {
b.bitmap_ &^= 512
b.bitmap_ &^= 1024
}
return b
}

// Subnet sets the value of the 'subnet' attribute to the given value.
func (b *NodePoolBuilder) Subnet(value string) *NodePoolBuilder {
b.subnet = value
b.bitmap_ |= 1024
b.bitmap_ |= 2048
return b
}

// Taints sets the value of the 'taints' attribute to the given values.
func (b *NodePoolBuilder) Taints(values ...*TaintBuilder) *NodePoolBuilder {
b.taints = make([]*TaintBuilder, len(values))
copy(b.taints, values)
b.bitmap_ |= 2048
b.bitmap_ |= 4096
return b
}

// TuningConfigs sets the value of the 'tuning_configs' attribute to the given values.
func (b *NodePoolBuilder) TuningConfigs(values ...string) *NodePoolBuilder {
b.tuningConfigs = make([]string, len(values))
copy(b.tuningConfigs, values)
b.bitmap_ |= 4096
b.bitmap_ |= 8192
return b
}

Expand All @@ -169,9 +200,9 @@ func (b *NodePoolBuilder) TuningConfigs(values ...string) *NodePoolBuilder {
func (b *NodePoolBuilder) Version(value *VersionBuilder) *NodePoolBuilder {
b.version = value
if value != nil {
b.bitmap_ |= 8192
b.bitmap_ |= 16384
} else {
b.bitmap_ &^= 8192
b.bitmap_ &^= 16384
}
return b
}
Expand Down Expand Up @@ -204,6 +235,11 @@ func (b *NodePoolBuilder) Copy(object *NodePool) *NodePoolBuilder {
} else {
b.labels = nil
}
if object.nodeDrainGracePeriod != nil {
b.nodeDrainGracePeriod = NewValue().Copy(object.nodeDrainGracePeriod)
} else {
b.nodeDrainGracePeriod = nil
}
b.replicas = object.replicas
if object.status != nil {
b.status = NewNodePoolStatus().Copy(object.status)
Expand Down Expand Up @@ -259,6 +295,12 @@ func (b *NodePoolBuilder) Build() (object *NodePool, err error) {
object.labels[k] = v
}
}
if b.nodeDrainGracePeriod != nil {
object.nodeDrainGracePeriod, err = b.nodeDrainGracePeriod.Build()
if err != nil {
return
}
}
object.replicas = b.replicas
if b.status != nil {
object.status, err = b.status.Build()
Expand Down
76 changes: 50 additions & 26 deletions clustersmgmt/v1/node_pool_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,21 @@ const NodePoolNilKind = "NodePoolNil"
//
// Representation of a node pool in a cluster.
type NodePool struct {
bitmap_ uint32
id string
href string
awsNodePool *AWSNodePool
autoscaling *NodePoolAutoscaling
availabilityZone string
labels map[string]string
replicas int
status *NodePoolStatus
subnet string
taints []*Taint
tuningConfigs []string
version *Version
autoRepair bool
bitmap_ uint32
id string
href string
awsNodePool *AWSNodePool
autoscaling *NodePoolAutoscaling
availabilityZone string
labels map[string]string
nodeDrainGracePeriod *Value
replicas int
status *NodePoolStatus
subnet string
taints []*Taint
tuningConfigs []string
version *Version
autoRepair bool
}

// Kind returns the name of the type of the object.
Expand Down Expand Up @@ -225,13 +226,36 @@ func (o *NodePool) GetLabels() (value map[string]string, ok bool) {
return
}

// NodeDrainGracePeriod returns the value of the 'node_drain_grace_period' attribute, or
// the zero value of the type if the attribute doesn't have a value.
//
// Time to wait for a NodePool to drain when it is upgraded or replaced before it is forcibly removed.
func (o *NodePool) NodeDrainGracePeriod() *Value {
if o != nil && o.bitmap_&256 != 0 {
return o.nodeDrainGracePeriod
}
return nil
}

// GetNodeDrainGracePeriod returns the value of the 'node_drain_grace_period' attribute and
// a flag indicating if the attribute has a value.
//
// Time to wait for a NodePool to drain when it is upgraded or replaced before it is forcibly removed.
func (o *NodePool) GetNodeDrainGracePeriod() (value *Value, ok bool) {
ok = o != nil && o.bitmap_&256 != 0
if ok {
value = o.nodeDrainGracePeriod
}
return
}

// Replicas returns the value of the 'replicas' attribute, or
// the zero value of the type if the attribute doesn't have a value.
//
// The number of Machines (and Nodes) to create.
// Replicas and autoscaling cannot be used together.
func (o *NodePool) Replicas() int {
if o != nil && o.bitmap_&256 != 0 {
if o != nil && o.bitmap_&512 != 0 {
return o.replicas
}
return 0
Expand All @@ -243,7 +267,7 @@ func (o *NodePool) Replicas() int {
// The number of Machines (and Nodes) to create.
// Replicas and autoscaling cannot be used together.
func (o *NodePool) GetReplicas() (value int, ok bool) {
ok = o != nil && o.bitmap_&256 != 0
ok = o != nil && o.bitmap_&512 != 0
if ok {
value = o.replicas
}
Expand All @@ -255,7 +279,7 @@ func (o *NodePool) GetReplicas() (value int, ok bool) {
//
// NodePool status.
func (o *NodePool) Status() *NodePoolStatus {
if o != nil && o.bitmap_&512 != 0 {
if o != nil && o.bitmap_&1024 != 0 {
return o.status
}
return nil
Expand All @@ -266,7 +290,7 @@ func (o *NodePool) Status() *NodePoolStatus {
//
// NodePool status.
func (o *NodePool) GetStatus() (value *NodePoolStatus, ok bool) {
ok = o != nil && o.bitmap_&512 != 0
ok = o != nil && o.bitmap_&1024 != 0
if ok {
value = o.status
}
Expand All @@ -278,7 +302,7 @@ func (o *NodePool) GetStatus() (value *NodePoolStatus, ok bool) {
//
// The subnet upon which the nodes are created.
func (o *NodePool) Subnet() string {
if o != nil && o.bitmap_&1024 != 0 {
if o != nil && o.bitmap_&2048 != 0 {
return o.subnet
}
return ""
Expand All @@ -289,7 +313,7 @@ func (o *NodePool) Subnet() string {
//
// The subnet upon which the nodes are created.
func (o *NodePool) GetSubnet() (value string, ok bool) {
ok = o != nil && o.bitmap_&1024 != 0
ok = o != nil && o.bitmap_&2048 != 0
if ok {
value = o.subnet
}
Expand All @@ -301,7 +325,7 @@ func (o *NodePool) GetSubnet() (value string, ok bool) {
//
// The taints set on the Nodes created.
func (o *NodePool) Taints() []*Taint {
if o != nil && o.bitmap_&2048 != 0 {
if o != nil && o.bitmap_&4096 != 0 {
return o.taints
}
return nil
Expand All @@ -312,7 +336,7 @@ func (o *NodePool) Taints() []*Taint {
//
// The taints set on the Nodes created.
func (o *NodePool) GetTaints() (value []*Taint, ok bool) {
ok = o != nil && o.bitmap_&2048 != 0
ok = o != nil && o.bitmap_&4096 != 0
if ok {
value = o.taints
}
Expand All @@ -324,7 +348,7 @@ func (o *NodePool) GetTaints() (value []*Taint, ok bool) {
//
// The names of the tuning configs for this node pool.
func (o *NodePool) TuningConfigs() []string {
if o != nil && o.bitmap_&4096 != 0 {
if o != nil && o.bitmap_&8192 != 0 {
return o.tuningConfigs
}
return nil
Expand All @@ -335,7 +359,7 @@ func (o *NodePool) TuningConfigs() []string {
//
// The names of the tuning configs for this node pool.
func (o *NodePool) GetTuningConfigs() (value []string, ok bool) {
ok = o != nil && o.bitmap_&4096 != 0
ok = o != nil && o.bitmap_&8192 != 0
if ok {
value = o.tuningConfigs
}
Expand All @@ -347,7 +371,7 @@ func (o *NodePool) GetTuningConfigs() (value []string, ok bool) {
//
// Version of the node pool.
func (o *NodePool) Version() *Version {
if o != nil && o.bitmap_&8192 != 0 {
if o != nil && o.bitmap_&16384 != 0 {
return o.version
}
return nil
Expand All @@ -358,7 +382,7 @@ func (o *NodePool) Version() *Version {
//
// Version of the node pool.
func (o *NodePool) GetVersion() (value *Version, ok bool) {
ok = o != nil && o.bitmap_&8192 != 0
ok = o != nil && o.bitmap_&16384 != 0
if ok {
value = o.version
}
Expand Down
Loading
Loading