Skip to content

Commit

Permalink
Remove template release tag from template name
Browse files Browse the repository at this point in the history
The release tag is kept it the labels for template itself
and in the VM object the template describes. There is
no change there.

Adding the version tag to the template name was a mistake
that will break upgrades. The name should never change.

When an incompatible change is needed, a copy of a template
should be created, given new name and edited as needed.
The original must stay backwards compatible forever!

Signed-off-by: Martin Sivak <[email protected]>
  • Loading branch information
MarSik committed Nov 11, 2019
1 parent 72d7d2c commit 86642b5
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 8 deletions.
4 changes: 4 additions & 0 deletions templates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ Also, there might be multiple different OSes, flavors, sizes mentioned by any si

Please note that the kubevirt.io suffix used in labels and annotations is temporary and is likely to change.

## Template edits

When an incompatible change is needed, a copy of a template should be created, given new name and edited as needed. The original must stay backwards compatible forever!

## User Experience

The flow should be the same as usual with regards to openshift templates. The user either takes a local template and generates a VM object.
Expand Down
1 change: 1 addition & 0 deletions templates/_linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
workload.template.kubevirt.io/{{ item.workload }}: "true"
flavor.template.kubevirt.io/{{ item.flavor }}: "true"
template.kubevirt.io/type: "base"
template.kubevirt.io/version: "{{ lookup('env', 'VERSION') | default('devel', true) }}"

objects:
- apiVersion: kubevirt.io/v1alpha3
Expand Down
2 changes: 1 addition & 1 deletion templates/centos6.tpl.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: template.openshift.io/v1
kind: Template
metadata:
name: {{ os }}-{{ item.workload }}-{{ item.flavor }}-{{ lookup('env', 'VERSION') | default('devel', true) }}
name: {{ os }}-{{ item.workload }}-{{ item.flavor }}
annotations:
openshift.io/display-name: "CentOS 6.0+ VM"
description: >-
Expand Down
2 changes: 1 addition & 1 deletion templates/centos7.tpl.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: template.openshift.io/v1
kind: Template
metadata:
name: {{ os }}-{{ item.workload }}-{{ item.flavor }}-{{ lookup('env', 'VERSION') | default('devel', true) }}
name: {{ os }}-{{ item.workload }}-{{ item.flavor }}
annotations:
openshift.io/display-name: "CentOS 7.0+ VM"
description: >-
Expand Down
2 changes: 1 addition & 1 deletion templates/fedora.tpl.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: template.openshift.io/v1
kind: Template
metadata:
name: {{ os }}-{{ item.workload }}-{{ item.flavor }}-{{ lookup('env', 'VERSION') | default('devel', true) }}
name: {{ os }}-{{ item.workload }}-{{ item.flavor }}
annotations:
openshift.io/display-name: "Fedora 23+ VM"
description: >-
Expand Down
2 changes: 1 addition & 1 deletion templates/opensuse.tpl.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: template.openshift.io/v1
kind: Template
metadata:
name: {{ os }}-{{ item.workload }}-{{ item.flavor }}-{{ lookup('env', 'VERSION') | default('devel', true) }}
name: {{ os }}-{{ item.workload }}-{{ item.flavor }}
annotations:
openshift.io/display-name: "OpenSUSE Leap 15.0 VM"
description: >-
Expand Down
2 changes: 1 addition & 1 deletion templates/rhel6.tpl.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: template.openshift.io/v1
kind: Template
metadata:
name: {{ os }}-{{ item.workload }}-{{ item.flavor }}-{{ lookup('env', 'VERSION') | default('devel', true) }}
name: {{ os }}-{{ item.workload }}-{{ item.flavor }}
annotations:
openshift.io/display-name: "Red Hat Enterprise Linux 6.0+ VM"
description: >-
Expand Down
2 changes: 1 addition & 1 deletion templates/rhel7.tpl.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: template.openshift.io/v1
kind: Template
metadata:
name: {{ os }}-{{ item.workload }}-{{ item.flavor }}-{{ lookup('env', 'VERSION') | default('devel', true) }}
name: {{ os }}-{{ item.workload }}-{{ item.flavor }}
annotations:
openshift.io/display-name: "Red Hat Enterprise Linux 7.0+ VM"
description: >-
Expand Down
2 changes: 1 addition & 1 deletion templates/ubuntu.tpl.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: template.openshift.io/v1
kind: Template
metadata:
name: {{ os }}-{{ item.workload }}-{{ item.flavor }}-{{ lookup('env', 'VERSION') | default('devel', true) }}
name: {{ os }}-{{ item.workload }}-{{ item.flavor }}
annotations:
openshift.io/display-name: "Ubuntu 18.04 (Xenial Xerus) VM"
description: >-
Expand Down
3 changes: 2 additions & 1 deletion templates/win2k12r2.tpl.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: template.openshift.io/v1
kind: Template
metadata:
name: win2k12r2-{{ item.workload }}-{{ item.flavor }}-{{ lookup('env', 'VERSION') | default('devel', true) }}
name: win2k12r2-{{ item.workload }}-{{ item.flavor }}
annotations:
openshift.io/display-name: "Microsoft Windows Server 2012 R2 VM"
description: >-
Expand Down Expand Up @@ -67,6 +67,7 @@ metadata:
workload.template.kubevirt.io/{{ item.workload }}: "true"
flavor.template.kubevirt.io/{{ item.flavor }}: "true"
template.kubevirt.io/type: "base"
template.kubevirt.io/version: "{{ lookup('env', 'VERSION') | default('devel', true) }}"

objects:
- apiVersion: kubevirt.io/v1alpha3
Expand Down

0 comments on commit 86642b5

Please sign in to comment.