File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -69,11 +69,21 @@ func GetPodTemplateSpec(obj *unstructured.Unstructured, path string) (*v1.PodTem
6969 // Metadata
7070 dst := & v1.PodTemplateSpec {}
7171 if metadata , ok := candidatePTS ["metadata" ].(map [string ]interface {}); ok {
72- if labels , ok := metadata ["labels" ].(map [string ]string ); ok {
73- dst .Labels = labels
72+ if labels , ok := metadata ["labels" ].(map [string ]interface {}); ok {
73+ dst .Labels = make (map [string ]string )
74+ for k , v := range labels {
75+ if str , ok := v .(string ); ok {
76+ dst .Labels [k ] = str
77+ }
78+ }
7479 }
75- if annotations , ok := metadata ["annotations" ].(map [string ]string ); ok {
76- dst .Annotations = annotations
80+ if annotations , ok := metadata ["annotations" ].(map [string ]interface {}); ok {
81+ dst .Annotations = make (map [string ]string )
82+ for k , v := range annotations {
83+ if str , ok := v .(string ); ok {
84+ dst .Annotations [k ] = str
85+ }
86+ }
7787 }
7888 }
7989
You can’t perform that action at this time.
0 commit comments