mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-09 05:25:14 +09:00
[Backport release-1.4] fix(kubernetes): stamp application lineage labels on worker node VMs (#2790)
# Description Backport of #2779 to `release-1.4`.
This commit is contained in:
2 files changed
+38
No files matched your search
@@ -55,6 +55,9 @@ spec:
|
||||
annotations:
|
||||
kubevirt.io/allow-pod-bridge-network-live-migration: "true"
|
||||
labels:
|
||||
apps.cozystack.io/application.group: apps.cozystack.io
|
||||
apps.cozystack.io/application.kind: Kubernetes
|
||||
apps.cozystack.io/application.name: {{ $.Release.Name | trimPrefix "kubernetes-" | quote }}
|
||||
{{- range .group.roles }}
|
||||
node-role.kubernetes.io/{{ . }}: ""
|
||||
{{- end }}
|
||||
|
||||
@@ -444,3 +444,38 @@ tests:
|
||||
if /root/kubelet --version ; then mv /root/kubelet /usr/bin/kubelet ; fi
|
||||
if /root/kubeadm version ; then mv /root/kubeadm /usr/bin/kubeadm ; fi
|
||||
documentIndex: 4
|
||||
|
||||
###############################################
|
||||
# application lineage labels on worker VMs #
|
||||
###############################################
|
||||
|
||||
- it: stamps application lineage labels on the worker VM template
|
||||
release:
|
||||
name: test-k8s
|
||||
namespace: tenant-test
|
||||
asserts:
|
||||
- isKind:
|
||||
of: KubevirtMachineTemplate
|
||||
documentIndex: 5
|
||||
- equal:
|
||||
path: spec.template.spec.virtualMachineTemplate.spec.template.metadata.labels["apps.cozystack.io/application.group"]
|
||||
value: apps.cozystack.io
|
||||
documentIndex: 5
|
||||
- equal:
|
||||
path: spec.template.spec.virtualMachineTemplate.spec.template.metadata.labels["apps.cozystack.io/application.kind"]
|
||||
value: Kubernetes
|
||||
documentIndex: 5
|
||||
- equal:
|
||||
path: spec.template.spec.virtualMachineTemplate.spec.template.metadata.labels["apps.cozystack.io/application.name"]
|
||||
value: test-k8s
|
||||
documentIndex: 5
|
||||
|
||||
- it: derives application.name by trimming the kubernetes- release prefix
|
||||
release:
|
||||
name: kubernetes-foo
|
||||
namespace: tenant-test
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.template.spec.virtualMachineTemplate.spec.template.metadata.labels["apps.cozystack.io/application.name"]
|
||||
value: foo
|
||||
documentIndex: 5
|
||||
Reference in new issue
Block a user