Add annotations to Cluster.fleet object (#236) (#237)

Copy annotations from CAPI cluster to cluster.fleet object

Signed-off-by: Dinar Valeev <k0da@opensuse.org>
Co-authored-by: Dinar Valeev <k0da@opensuse.org>
This commit is contained in:
Danil Grigorev 2025-03-31 10:11:23 +02:00 committed by GitHub
parent de9c79c6d4
commit ed563c42be
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 0 deletions

View File

@ -89,6 +89,7 @@ impl Cluster {
let class = self.cluster_class_name();
let ns = self.namespace().unwrap_or_default();
let class_namespace = self.cluster_class_namespace().unwrap_or(&ns);
let annotations = self.annotations().clone();
let labels = {
let mut labels = self.labels().clone();
if let Some(class) = class {
@ -104,6 +105,7 @@ impl Cluster {
fleet_cluster::Cluster {
types: Some(TypeMeta::resource::<fleet_cluster::Cluster>()),
metadata: ObjectMeta {
annotations: Some(annotations),
labels: Some(labels),
owner_references: config
.set_owner_references

View File

@ -9,6 +9,8 @@ spec: {}
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
annotations:
example.com/annotation: test
labels:
import: ""
cni: kindnet