Skip to content

Commit

Permalink
OCM-10678 | fix: tag must have value with map[string]interface{}
Browse files Browse the repository at this point in the history
  • Loading branch information
aaraj7 committed Aug 27, 2024
1 parent 97699ae commit c1abafd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions clustersmgmt/v1/aws_node_pool_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type AWSNodePoolBuilder struct {
instanceType string
rootVolume *AWSVolumeBuilder
subnetOutposts map[string]string
tags map[string]string
tags map[string]interface{}
}

// NewAWSNodePool creates a new builder of 'AWS_node_pool' objects.
Expand Down Expand Up @@ -133,7 +133,7 @@ func (b *AWSNodePoolBuilder) SubnetOutposts(value map[string]string) *AWSNodePoo
}

// Tags sets the value of the 'tags' attribute to the given value.
func (b *AWSNodePoolBuilder) Tags(value map[string]string) *AWSNodePoolBuilder {
func (b *AWSNodePoolBuilder) Tags(value map[string]interface{}) *AWSNodePoolBuilder {
b.tags = value
if value != nil {
b.bitmap_ |= 1024
Expand Down Expand Up @@ -182,7 +182,7 @@ func (b *AWSNodePoolBuilder) Copy(object *AWSNodePool) *AWSNodePoolBuilder {
b.subnetOutposts = nil
}
if len(object.tags) > 0 {
b.tags = map[string]string{}
b.tags = map[string]interface{}{}
for k, v := range object.tags {
b.tags[k] = v
}
Expand Down Expand Up @@ -224,7 +224,7 @@ func (b *AWSNodePoolBuilder) Build() (object *AWSNodePool, err error) {
}
}
if b.tags != nil {
object.tags = make(map[string]string)
object.tags = make(map[string]interface{})
for k, v := range b.tags {
object.tags[k] = v
}
Expand Down
6 changes: 3 additions & 3 deletions clustersmgmt/v1/aws_node_pool_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ type AWSNodePool struct {
instanceType string
rootVolume *AWSVolume
subnetOutposts map[string]string
tags map[string]string
tags map[string]interface{}
}

// Kind returns the name of the type of the object.
Expand Down Expand Up @@ -277,7 +277,7 @@ func (o *AWSNodePool) GetSubnetOutposts() (value map[string]string, ok bool) {
// - Tag keys may be between 1 and 128 characters in length
// - Tag values may be between 0 and 256 characters in length
// - Tags may only contain letters, numbers, spaces, and the following characters: [_ . : / = + - @]
func (o *AWSNodePool) Tags() map[string]string {
func (o *AWSNodePool) Tags() map[string]interface{} {
if o != nil && o.bitmap_&1024 != 0 {
return o.tags
}
Expand All @@ -295,7 +295,7 @@ func (o *AWSNodePool) Tags() map[string]string {
// - Tag keys may be between 1 and 128 characters in length
// - Tag values may be between 0 and 256 characters in length
// - Tags may only contain letters, numbers, spaces, and the following characters: [_ . : / = + - @]
func (o *AWSNodePool) GetTags() (value map[string]string, ok bool) {
func (o *AWSNodePool) GetTags() (value map[string]interface{}, ok bool) {
ok = o != nil && o.bitmap_&1024 != 0
if ok {
value = o.tags
Expand Down
6 changes: 3 additions & 3 deletions clustersmgmt/v1/aws_node_pool_type_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func writeAWSNodePool(object *AWSNodePool, stream *jsoniter.Stream) {
}
item := object.tags[key]
stream.WriteObjectField(key)
stream.WriteString(item)
stream.WriteVal(item)
}
stream.WriteObjectEnd()
} else {
Expand Down Expand Up @@ -278,13 +278,13 @@ func readAWSNodePool(iterator *jsoniter.Iterator) *AWSNodePool {
object.subnetOutposts = value
object.bitmap_ |= 512
case "tags":
value := map[string]string{}
value := map[string]interface{}{}
for {
key := iterator.ReadObject()
if key == "" {
break
}
item := iterator.ReadString()
item := iterator.Read()
value[key] = item
}
object.tags = value
Expand Down

0 comments on commit c1abafd

Please sign in to comment.