File tree 2 files changed +35
-0
lines changed
pkg/controller/resourcegraphdefinition
2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change
1
+ // This file will be moved to examples/kubernetes/test-metadata.yaml
2
+
3
+ apiVersion : kro.run/v1alpha1
4
+ kind : ResourceGraphDefinition
5
+ metadata :
6
+ name : using-metadata
7
+ spec :
8
+ schema :
9
+ apiVersion : v1alpha1
10
+ kind : UsingMetadata
11
+ spec :
12
+ data :
13
+ foo : string
14
+ bar : integer
15
+ status :
16
+ created : ${configmap.metadata.creationTimestamp}
17
+ resources :
18
+ - id : configmap
19
+ template :
20
+ apiVersion : v1
21
+ kind : ConfigMap
22
+ metadata :
23
+ name : ${instance.metadata.name + "-cm"}
24
+ data :
25
+ foo : ${schema.spec.data.foo}
26
+ bar : ${string(schema.spec.data.bar)}
Original file line number Diff line number Diff line change @@ -130,6 +130,15 @@ func (r *ResourceGraphDefinitionReconciler) setResourceGraphDefinitionStatus(
130
130
dc .Status .TopologicalOrder = topologicalOrder
131
131
dc .Status .Resources = resources
132
132
133
+ // Ensure metadata fields are included in the status update
134
+ metadata := resourcegraphdefinition .Object ["metadata" ].(map [string ]interface {})
135
+ if metadata != nil {
136
+ dc .Status .Resources = append (dc .Status .Resources , v1alpha1.ResourceInformation {
137
+ ID : "metadata" ,
138
+ Dependencies : []v1alpha1.Dependency {},
139
+ })
140
+ }
141
+
133
142
log .V (1 ).Info ("updating resource graph definition status" ,
134
143
"state" , dc .Status .State ,
135
144
"conditions" , len (dc .Status .Conditions ),
You can’t perform that action at this time.
0 commit comments