From c1abafd8c1d342f7782fa983b69e9aaa01491d35 Mon Sep 17 00:00:00 2001 From: aaraj Date: Tue, 27 Aug 2024 20:11:59 +0530 Subject: [PATCH] OCM-10678 | fix: tag must have value with map[string]interface{} --- clustersmgmt/v1/aws_node_pool_builder.go | 8 ++++---- clustersmgmt/v1/aws_node_pool_type.go | 6 +++--- clustersmgmt/v1/aws_node_pool_type_json.go | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/clustersmgmt/v1/aws_node_pool_builder.go b/clustersmgmt/v1/aws_node_pool_builder.go index d375e7f9c..684db73ec 100644 --- a/clustersmgmt/v1/aws_node_pool_builder.go +++ b/clustersmgmt/v1/aws_node_pool_builder.go @@ -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. @@ -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 @@ -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 } @@ -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 } diff --git a/clustersmgmt/v1/aws_node_pool_type.go b/clustersmgmt/v1/aws_node_pool_type.go index d21828199..44514f69d 100644 --- a/clustersmgmt/v1/aws_node_pool_type.go +++ b/clustersmgmt/v1/aws_node_pool_type.go @@ -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. @@ -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 } @@ -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 diff --git a/clustersmgmt/v1/aws_node_pool_type_json.go b/clustersmgmt/v1/aws_node_pool_type_json.go index c2722bbf9..d4d5ea2bf 100644 --- a/clustersmgmt/v1/aws_node_pool_type_json.go +++ b/clustersmgmt/v1/aws_node_pool_type_json.go @@ -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 { @@ -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