Skip to content

Commit

Permalink
Revert "Merge pull request openshift-online#907 from den-rgb/OCM-5976"
Browse files Browse the repository at this point in the history
This reverts commit 940b15c, reversing
changes made to 1118e3f.
  • Loading branch information
oriAdler committed Feb 18, 2024
1 parent 940b15c commit 22871f0
Show file tree
Hide file tree
Showing 17 changed files with 18,899 additions and 17,046 deletions.
7 changes: 0 additions & 7 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@
This document describes the relevant changes between releases of the OCM API
SDK.

## 0.1.402
- Update model version v0.0.355
- Removed undefined api calls from the model
- Add support to `securestore` that allows the caller to define a keyring target
- Additional `securestore` Error Standardization
- Add error handling to `securestore` for denied Keychain access due to permissions

## 0.1.401
- Update model version v0.0.353
- Added support for `PackageImage` for `clusters_mgmt`
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.355
model_version:=v0.0.353
model_url:=https://github.com/openshift-online/ocm-api-model.git

# Details of the metamodel to use:
Expand Down
51 changes: 16 additions & 35 deletions clustersmgmt/v1/aws_node_pool_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,14 @@ package v1 // github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1
//
// Representation of aws node pool specific parameters.
type AWSNodePoolBuilder struct {
bitmap_ uint32
id string
href string
additionalSecurityGroupIds []string
availabilityZoneTypes map[string]string
instanceProfile string
instanceType string
subnetOutposts map[string]string
tags map[string]string
bitmap_ uint32
id string
href string
availabilityZoneTypes map[string]string
instanceProfile string
instanceType string
subnetOutposts map[string]string
tags map[string]string
}

// NewAWSNodePool creates a new builder of 'AWS_node_pool' objects.
Expand Down Expand Up @@ -64,46 +63,38 @@ func (b *AWSNodePoolBuilder) Empty() bool {
return b == nil || b.bitmap_&^1 == 0
}

// AdditionalSecurityGroupIds sets the value of the 'additional_security_group_ids' attribute to the given values.
func (b *AWSNodePoolBuilder) AdditionalSecurityGroupIds(values ...string) *AWSNodePoolBuilder {
b.additionalSecurityGroupIds = make([]string, len(values))
copy(b.additionalSecurityGroupIds, values)
b.bitmap_ |= 8
return b
}

// AvailabilityZoneTypes sets the value of the 'availability_zone_types' attribute to the given value.
func (b *AWSNodePoolBuilder) AvailabilityZoneTypes(value map[string]string) *AWSNodePoolBuilder {
b.availabilityZoneTypes = value
if value != nil {
b.bitmap_ |= 16
b.bitmap_ |= 8
} else {
b.bitmap_ &^= 16
b.bitmap_ &^= 8
}
return b
}

// InstanceProfile sets the value of the 'instance_profile' attribute to the given value.
func (b *AWSNodePoolBuilder) InstanceProfile(value string) *AWSNodePoolBuilder {
b.instanceProfile = value
b.bitmap_ |= 32
b.bitmap_ |= 16
return b
}

// InstanceType sets the value of the 'instance_type' attribute to the given value.
func (b *AWSNodePoolBuilder) InstanceType(value string) *AWSNodePoolBuilder {
b.instanceType = value
b.bitmap_ |= 64
b.bitmap_ |= 32
return b
}

// SubnetOutposts sets the value of the 'subnet_outposts' attribute to the given value.
func (b *AWSNodePoolBuilder) SubnetOutposts(value map[string]string) *AWSNodePoolBuilder {
b.subnetOutposts = value
if value != nil {
b.bitmap_ |= 128
b.bitmap_ |= 64
} else {
b.bitmap_ &^= 128
b.bitmap_ &^= 64
}
return b
}
Expand All @@ -112,9 +103,9 @@ func (b *AWSNodePoolBuilder) SubnetOutposts(value map[string]string) *AWSNodePoo
func (b *AWSNodePoolBuilder) Tags(value map[string]string) *AWSNodePoolBuilder {
b.tags = value
if value != nil {
b.bitmap_ |= 256
b.bitmap_ |= 128
} else {
b.bitmap_ &^= 256
b.bitmap_ &^= 128
}
return b
}
Expand All @@ -127,12 +118,6 @@ func (b *AWSNodePoolBuilder) Copy(object *AWSNodePool) *AWSNodePoolBuilder {
b.bitmap_ = object.bitmap_
b.id = object.id
b.href = object.href
if object.additionalSecurityGroupIds != nil {
b.additionalSecurityGroupIds = make([]string, len(object.additionalSecurityGroupIds))
copy(b.additionalSecurityGroupIds, object.additionalSecurityGroupIds)
} else {
b.additionalSecurityGroupIds = nil
}
if len(object.availabilityZoneTypes) > 0 {
b.availabilityZoneTypes = map[string]string{}
for k, v := range object.availabilityZoneTypes {
Expand Down Expand Up @@ -168,10 +153,6 @@ func (b *AWSNodePoolBuilder) Build() (object *AWSNodePool, err error) {
object.id = b.id
object.href = b.href
object.bitmap_ = b.bitmap_
if b.additionalSecurityGroupIds != nil {
object.additionalSecurityGroupIds = make([]string, len(b.additionalSecurityGroupIds))
copy(object.additionalSecurityGroupIds, b.additionalSecurityGroupIds)
}
if b.availabilityZoneTypes != nil {
object.availabilityZoneTypes = make(map[string]string)
for k, v := range b.availabilityZoneTypes {
Expand Down
60 changes: 18 additions & 42 deletions clustersmgmt/v1/aws_node_pool_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,14 @@ const AWSNodePoolNilKind = "AWSNodePoolNil"
//
// Representation of aws node pool specific parameters.
type AWSNodePool struct {
bitmap_ uint32
id string
href string
additionalSecurityGroupIds []string
availabilityZoneTypes map[string]string
instanceProfile string
instanceType string
subnetOutposts map[string]string
tags map[string]string
bitmap_ uint32
id string
href string
availabilityZoneTypes map[string]string
instanceProfile string
instanceType string
subnetOutposts map[string]string
tags map[string]string
}

// Kind returns the name of the type of the object.
Expand Down Expand Up @@ -103,35 +102,12 @@ func (o *AWSNodePool) Empty() bool {
return o == nil || o.bitmap_&^1 == 0
}

// AdditionalSecurityGroupIds returns the value of the 'additional_security_group_ids' attribute, or
// the zero value of the type if the attribute doesn't have a value.
//
// Additional AWS Security Groups to be added node pool.
func (o *AWSNodePool) AdditionalSecurityGroupIds() []string {
if o != nil && o.bitmap_&8 != 0 {
return o.additionalSecurityGroupIds
}
return nil
}

// GetAdditionalSecurityGroupIds returns the value of the 'additional_security_group_ids' attribute and
// a flag indicating if the attribute has a value.
//
// Additional AWS Security Groups to be added node pool.
func (o *AWSNodePool) GetAdditionalSecurityGroupIds() (value []string, ok bool) {
ok = o != nil && o.bitmap_&8 != 0
if ok {
value = o.additionalSecurityGroupIds
}
return
}

// AvailabilityZoneTypes returns the value of the 'availability_zone_types' attribute, or
// the zero value of the type if the attribute doesn't have a value.
//
// Associates nodepool availability zones with zone types (e.g. wavelength, local).
func (o *AWSNodePool) AvailabilityZoneTypes() map[string]string {
if o != nil && o.bitmap_&16 != 0 {
if o != nil && o.bitmap_&8 != 0 {
return o.availabilityZoneTypes
}
return nil
Expand All @@ -142,7 +118,7 @@ func (o *AWSNodePool) AvailabilityZoneTypes() map[string]string {
//
// Associates nodepool availability zones with zone types (e.g. wavelength, local).
func (o *AWSNodePool) GetAvailabilityZoneTypes() (value map[string]string, ok bool) {
ok = o != nil && o.bitmap_&16 != 0
ok = o != nil && o.bitmap_&8 != 0
if ok {
value = o.availabilityZoneTypes
}
Expand All @@ -154,7 +130,7 @@ func (o *AWSNodePool) GetAvailabilityZoneTypes() (value map[string]string, ok bo
//
// InstanceProfile is the AWS EC2 instance profile, which is a container for an IAM role that the EC2 instance uses.
func (o *AWSNodePool) InstanceProfile() string {
if o != nil && o.bitmap_&32 != 0 {
if o != nil && o.bitmap_&16 != 0 {
return o.instanceProfile
}
return ""
Expand All @@ -165,7 +141,7 @@ func (o *AWSNodePool) InstanceProfile() string {
//
// InstanceProfile is the AWS EC2 instance profile, which is a container for an IAM role that the EC2 instance uses.
func (o *AWSNodePool) GetInstanceProfile() (value string, ok bool) {
ok = o != nil && o.bitmap_&32 != 0
ok = o != nil && o.bitmap_&16 != 0
if ok {
value = o.instanceProfile
}
Expand All @@ -177,7 +153,7 @@ func (o *AWSNodePool) GetInstanceProfile() (value string, ok bool) {
//
// InstanceType is an ec2 instance type for node instances (e.g. m5.large).
func (o *AWSNodePool) InstanceType() string {
if o != nil && o.bitmap_&64 != 0 {
if o != nil && o.bitmap_&32 != 0 {
return o.instanceType
}
return ""
Expand All @@ -188,7 +164,7 @@ func (o *AWSNodePool) InstanceType() string {
//
// InstanceType is an ec2 instance type for node instances (e.g. m5.large).
func (o *AWSNodePool) GetInstanceType() (value string, ok bool) {
ok = o != nil && o.bitmap_&64 != 0
ok = o != nil && o.bitmap_&32 != 0
if ok {
value = o.instanceType
}
Expand All @@ -200,7 +176,7 @@ func (o *AWSNodePool) GetInstanceType() (value string, ok bool) {
//
// Associates nodepool subnets with AWS Outposts.
func (o *AWSNodePool) SubnetOutposts() map[string]string {
if o != nil && o.bitmap_&128 != 0 {
if o != nil && o.bitmap_&64 != 0 {
return o.subnetOutposts
}
return nil
Expand All @@ -211,7 +187,7 @@ func (o *AWSNodePool) SubnetOutposts() map[string]string {
//
// Associates nodepool subnets with AWS Outposts.
func (o *AWSNodePool) GetSubnetOutposts() (value map[string]string, ok bool) {
ok = o != nil && o.bitmap_&128 != 0
ok = o != nil && o.bitmap_&64 != 0
if ok {
value = o.subnetOutposts
}
Expand All @@ -223,7 +199,7 @@ func (o *AWSNodePool) GetSubnetOutposts() (value map[string]string, ok bool) {
//
// Optional keys and values that the installer will add as tags to all AWS resources it creates.
func (o *AWSNodePool) Tags() map[string]string {
if o != nil && o.bitmap_&256 != 0 {
if o != nil && o.bitmap_&128 != 0 {
return o.tags
}
return nil
Expand All @@ -234,7 +210,7 @@ func (o *AWSNodePool) Tags() map[string]string {
//
// Optional keys and values that the installer will add as tags to all AWS resources it creates.
func (o *AWSNodePool) GetTags() (value map[string]string, ok bool) {
ok = o != nil && o.bitmap_&256 != 0
ok = o != nil && o.bitmap_&128 != 0
if ok {
value = o.tags
}
Expand Down
33 changes: 10 additions & 23 deletions clustersmgmt/v1/aws_node_pool_type_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,7 @@ func writeAWSNodePool(object *AWSNodePool, stream *jsoniter.Stream) {
count++
}
var present_ bool
present_ = object.bitmap_&8 != 0 && object.additionalSecurityGroupIds != nil
if present_ {
if count > 0 {
stream.WriteMore()
}
stream.WriteObjectField("additional_security_group_ids")
writeStringList(object.additionalSecurityGroupIds, stream)
count++
}
present_ = object.bitmap_&16 != 0 && object.availabilityZoneTypes != nil
present_ = object.bitmap_&8 != 0 && object.availabilityZoneTypes != nil
if present_ {
if count > 0 {
stream.WriteMore()
Expand Down Expand Up @@ -104,7 +95,7 @@ func writeAWSNodePool(object *AWSNodePool, stream *jsoniter.Stream) {
}
count++
}
present_ = object.bitmap_&32 != 0
present_ = object.bitmap_&16 != 0
if present_ {
if count > 0 {
stream.WriteMore()
Expand All @@ -113,7 +104,7 @@ func writeAWSNodePool(object *AWSNodePool, stream *jsoniter.Stream) {
stream.WriteString(object.instanceProfile)
count++
}
present_ = object.bitmap_&64 != 0
present_ = object.bitmap_&32 != 0
if present_ {
if count > 0 {
stream.WriteMore()
Expand All @@ -122,7 +113,7 @@ func writeAWSNodePool(object *AWSNodePool, stream *jsoniter.Stream) {
stream.WriteString(object.instanceType)
count++
}
present_ = object.bitmap_&128 != 0 && object.subnetOutposts != nil
present_ = object.bitmap_&64 != 0 && object.subnetOutposts != nil
if present_ {
if count > 0 {
stream.WriteMore()
Expand Down Expand Up @@ -151,7 +142,7 @@ func writeAWSNodePool(object *AWSNodePool, stream *jsoniter.Stream) {
}
count++
}
present_ = object.bitmap_&256 != 0 && object.tags != nil
present_ = object.bitmap_&128 != 0 && object.tags != nil
if present_ {
if count > 0 {
stream.WriteMore()
Expand Down Expand Up @@ -214,10 +205,6 @@ func readAWSNodePool(iterator *jsoniter.Iterator) *AWSNodePool {
case "href":
object.href = iterator.ReadString()
object.bitmap_ |= 4
case "additional_security_group_ids":
value := readStringList(iterator)
object.additionalSecurityGroupIds = value
object.bitmap_ |= 8
case "availability_zone_types":
value := map[string]string{}
for {
Expand All @@ -229,15 +216,15 @@ func readAWSNodePool(iterator *jsoniter.Iterator) *AWSNodePool {
value[key] = item
}
object.availabilityZoneTypes = value
object.bitmap_ |= 16
object.bitmap_ |= 8
case "instance_profile":
value := iterator.ReadString()
object.instanceProfile = value
object.bitmap_ |= 32
object.bitmap_ |= 16
case "instance_type":
value := iterator.ReadString()
object.instanceType = value
object.bitmap_ |= 64
object.bitmap_ |= 32
case "subnet_outposts":
value := map[string]string{}
for {
Expand All @@ -249,7 +236,7 @@ func readAWSNodePool(iterator *jsoniter.Iterator) *AWSNodePool {
value[key] = item
}
object.subnetOutposts = value
object.bitmap_ |= 128
object.bitmap_ |= 64
case "tags":
value := map[string]string{}
for {
Expand All @@ -261,7 +248,7 @@ func readAWSNodePool(iterator *jsoniter.Iterator) *AWSNodePool {
value[key] = item
}
object.tags = value
object.bitmap_ |= 256
object.bitmap_ |= 128
default:
iterator.ReadAny()
}
Expand Down
10 changes: 10 additions & 0 deletions clustersmgmt/v1/cluster_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,16 @@ func (c *ClusterClient) NodePools() *NodePoolsClient {
)
}

// Product returns the target 'product' resource.
//
// Reference to the resource that manages the product type of the cluster
func (c *ClusterClient) Product() *ProductClient {
return NewProductClient(
c.transport,
path.Join(c.path, "product"),
)
}

// ProvisionShard returns the target 'provision_shard' resource.
//
// Reference to the resource that manages the cluster's provision shard.
Expand Down
Loading

0 comments on commit 22871f0

Please sign in to comment.