File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ func NewK8sManifestsFromPatternfile(patternFile *pattern.PatternFile) (string, e
39
39
func CreateK8sResourceStructure (comp * component.ComponentDefinition ) map [string ]interface {} {
40
40
annotations := map [string ]interface {}{}
41
41
labels := map [string ]interface {}{}
42
+ namespace := "default"
42
43
43
44
_confMetadata , ok := comp .Configuration ["metadata" ]
44
45
if ok {
@@ -51,10 +52,14 @@ func CreateK8sResourceStructure(comp *component.ComponentDefinition) map[string]
51
52
}
52
53
53
54
_label , ok := confMetadata ["labels" ]
54
-
55
55
if ok {
56
56
labels , _ = utils.Cast [map [string ]interface {}](_label )
57
57
}
58
+
59
+ _ns , ok := confMetadata ["namespace" ]
60
+ if ok {
61
+ namespace , _ = utils.Cast [string ](_ns )
62
+ }
58
63
}
59
64
}
60
65
@@ -65,11 +70,12 @@ func CreateK8sResourceStructure(comp *component.ComponentDefinition) map[string]
65
70
"name" : comp .DisplayName ,
66
71
"annotations" : annotations ,
67
72
"labels" : labels ,
73
+ "namespace" : namespace ,
68
74
},
69
75
}
70
76
71
77
for k , v := range comp .Configuration {
72
- if k == "apiVersion" || k == "kind" || k == "metadata" {
78
+ if k == "apiVersion" || k == "kind" || k == "metadata" || k == "namespace" {
73
79
continue
74
80
}
75
81
You can’t perform that action at this time.
0 commit comments