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-10678 | fix: tag must have value with map[string]interface{} #989

Closed
wants to merge 1 commit into from
Closed
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
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{}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this requires a change it should be in the api model instead, the files for the SDK are auto generated

// IMPORTANT: This file has been generated automatically, refrain from modifying it manually as all

Tried to follow the ticket, but couldn't find the reason why this is a requirement

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I automated the test case through old sdk , not needed this PR now, Closing it

}

// 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
Loading