Skip to content

Commit ed563c4

Browse files
Danil-Grigorevk0da
andauthored
Add annotations to Cluster.fleet object (#236) (#237)
Copy annotations from CAPI cluster to cluster.fleet object Signed-off-by: Dinar Valeev <[email protected]> Co-authored-by: Dinar Valeev <[email protected]>
1 parent de9c79c commit ed563c4

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/api/capi_cluster.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ impl Cluster {
8989
let class = self.cluster_class_name();
9090
let ns = self.namespace().unwrap_or_default();
9191
let class_namespace = self.cluster_class_namespace().unwrap_or(&ns);
92+
let annotations = self.annotations().clone();
9293
let labels = {
9394
let mut labels = self.labels().clone();
9495
if let Some(class) = class {
@@ -104,6 +105,7 @@ impl Cluster {
104105
fleet_cluster::Cluster {
105106
types: Some(TypeMeta::resource::<fleet_cluster::Cluster>()),
106107
metadata: ObjectMeta {
108+
annotations: Some(annotations),
107109
labels: Some(labels),
108110
owner_references: config
109111
.set_owner_references

testdata/cluster_docker_kcp.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ spec: {}
99
apiVersion: cluster.x-k8s.io/v1beta1
1010
kind: Cluster
1111
metadata:
12+
annotations:
13+
example.com/annotation: test
1214
labels:
1315
import: ""
1416
cni: kindnet

0 commit comments

Comments
 (0)