Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

require spec.version to be set in Kiali CR and OSSMConsole CR. #818

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion IMPLEMENTATION.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The KO can support installing multiple versions of the Kiali server and OSSMC by

NOTE: If you need to add support for a new version or remove support for an obsolete version, see link:./DEVELOPING.adoc[DEVELOPING.adoc] for those instructions.

To tell the KO which version of Kiali or OSSMC to install, you set the `spec.version` field in the Kiali CR or OSSMConsole CR. If no `spec.version` is defined in the CR, the default Ansible role that is executed is defined in link:https://github.com/kiali/kiali-operator/blob/master/playbooks/default-playbook.yml[default-playbook.yml] (side note: the file, and the field inside it, are technically named incorrectly. This isn't the default _playbook_, instead it is the default _role_. But ignore that.) Today, the default version of the Ansible role that is invoked is called, literally, link:https://github.com/kiali/kiali-operator/tree/master/roles/default[default]. This `default` version is the only one that the upstream Kiali project officially supports. This version support is provided for use by other products that want to retain support for earlier Kiali versions (such as Red Hat OpenShift Service Mesh).
To tell the KO which version of Kiali or OSSMC to install, you must set the `spec.version` field in the Kiali CR or OSSMConsole CR. If no `spec.version` is defined in the CR, an error will result and the KO will abort. To use the default Ansible role, set `spec.version` to the literal string `default`. That default version of the Ansible role is called, literally, link:https://github.com/kiali/kiali-operator/tree/master/roles/default[default]. This `default` version is the only one that the upstream Kiali project officially supports. This version support is provided for use by other products that want to retain support for earlier Kiali versions (such as Red Hat OpenShift Service Mesh).

== Main Ansible Playbooks

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ spec:
version: consolelinks.console.openshift.io/v1
specDescriptors:
- displayName: Version
description: "The version of the Kiali Server to install. This is specified in the form 'vX.Y'. Check the documentation for the values that are valid and supported. When not specified, or when set to the string 'default', the latest supported version of the Kiali Server will be installed. Default: default"
description: "The version of the Kiali Server to install. This is specified in the form 'vX.Y'. Check the documentation for the values that are valid and supported. When set to the string 'default', the latest supported version of the Kiali Server will be installed. This setting must be explicitly specified."
path: version
x-descriptors:
- 'urn:alm:descriptor:com.tectonic.ui:text'
Expand Down Expand Up @@ -200,7 +200,7 @@ spec:
version: v1
specDescriptors:
- displayName: Version
description: "The version of OSSMC to install. This is specified in the form 'vX.Y'. Check the documentation for the values that are valid and supported. When not specified, or when set to the string 'default', the latest supported version of OSSMC will be installed. You must ensure this value is the same as the spec.version field in the Kiali CR that was used to install the Kiali Server, otherwise you are not guaranteed OSSMC will work properly. Default: default"
description: "The version of OSSMC to install. This is specified in the form 'vX.Y'. Check the documentation for the values that are valid and supported. When set to the string 'default', the latest supported version of OSSMC will be installed. You must ensure this value is the same as the spec.version field in the Kiali CR that was used to install the Kiali Server, otherwise you are not guaranteed OSSMC will work properly. This setting must be explicitly specified."
path: version
x-descriptors:
- 'urn:alm:descriptor:com.tectonic.ui:text'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ spec:
version: consolelinks.console.openshift.io/v1
specDescriptors:
- displayName: Version
description: "The version of the Kiali Server to install. This is specified in the form 'vX.Y'. Check the documentation for the values that are valid and supported. When not specified, or when set to the string 'default', the latest supported version of the Kiali Server will be installed. Default: default"
description: "The version of the Kiali Server to install. This is specified in the form 'vX.Y'. Check the documentation for the values that are valid and supported. When set to the string 'default', the latest supported version of the Kiali Server will be installed. This setting must be explicitly specified."
path: version
x-descriptors:
- 'urn:alm:descriptor:com.tectonic.ui:text'
Expand Down Expand Up @@ -210,7 +210,7 @@ spec:
version: v1
specDescriptors:
- displayName: Version
description: "The version of OSSMC to install. This is specified in the form 'vX.Y'. Check the documentation for the values that are valid and supported. When not specified, or when set to the string 'default', the latest supported version of OSSMC will be installed. You must ensure this value is the same as the spec.version field in the Kiali CR that was used to install the Kiali Server, otherwise you are not guaranteed OSSMC will work properly. Default: default"
description: "The version of OSSMC to install. This is specified in the form 'vX.Y'. Check the documentation for the values that are valid and supported. When set to the string 'default', the latest supported version of OSSMC will be installed. You must ensure this value is the same as the spec.version field in the Kiali CR that was used to install the Kiali Server, otherwise you are not guaranteed OSSMC will work properly. This setting must be explicitly specified."
path: version
x-descriptors:
- 'urn:alm:descriptor:com.tectonic.ui:text'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ spec:
version: route.openshift.io/v1
specDescriptors:
- displayName: Version
description: "The version of the Kiali Server to install. This is specified in the form 'vX.Y'. Check the documentation for the values that are valid and supported. When not specified, or when set to the string 'default', the latest supported version of the Kiali Server will be installed. Default: default"
description: "The version of the Kiali Server to install. This is specified in the form 'vX.Y'. Check the documentation for the values that are valid and supported. When set to the string 'default', the latest supported version of the Kiali Server will be installed. This setting must be explicitly specified."
path: version
x-descriptors:
- 'urn:alm:descriptor:com.tectonic.ui:text'
Expand Down
1 change: 0 additions & 1 deletion playbooks/default-playbook.yml

This file was deleted.

16 changes: 11 additions & 5 deletions playbooks/kiali-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,20 @@
set_fact:
playbook_time_start: "{{ '%Y-%m-%d %H:%M:%S' | strftime }}"

- name: Determine the default playbook
include_vars:
file: "default-playbook.yml"
name: default_playbook
- name: Ensure spec.version is specified - we must be told which version to install, abort otherwise
fail:
msg: |
The CR is missing the spec.version field.
You must explicitly indicate which version you want.
The spec.version field must be either the literal string 'default' or
one of the supported versions in the form of 'vX.Y'.
Please consult the Kiali documentation for more details.
when:
- (version is not defined) or (version | length == 0)

- name: Determine the version that is to be installed
set_fact:
version: "{{ version | default(default_playbook.playbook) }}"
version: "{{ version }}"

- name: If upgrade is in progress then run the old version-specific remove role to purge old install
include_role:
Expand Down
8 changes: 1 addition & 7 deletions playbooks/kiali-remove.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,9 @@
set_fact:
playbook_time_start: "{{ '%Y-%m-%d %H:%M:%S' | strftime }}"

- ignore_errors: yes
name: Determine the default playbook
include_vars:
file: "default-playbook.yml"
name: default_playbook

- ignore_errors: yes
include_role:
name: "{{ version | default(default_playbook.playbook) }}/kiali-remove"
name: "{{ version | default('default') }}/kiali-remove"

- ignore_errors: yes
name: Playbook end time
Expand Down
25 changes: 20 additions & 5 deletions playbooks/ossmconsole-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,29 @@
set_fact:
playbook_time_start: "{{ '%Y-%m-%d %H:%M:%S' | strftime }}"

- name: Determine the default playbook
include_vars:
file: "default-playbook.yml"
name: default_playbook
- name: Ensure spec.version is specified - we must be told which version to install, abort otherwise
fail:
msg: |
The CR is missing the spec.version field.
You must explicitly indicate which version you want.
The spec.version field must be either the literal string 'default' or
one of the supported versions in the form of 'vX.Y'.
Please consult the Kiali documentation for more details.
when:
- (version is not defined) or (version | length == 0)

- name: Determine the version that is to be installed
set_fact:
version: "{{ version | default(default_playbook.playbook) }}"
version: "{{ version }}"

- name: If upgrade is in progress then run the old version-specific remove role to purge old install
include_role:
name: "{{ _kiali_io_ossmconsole.status.specVersion }}/ossmconsole-remove"
when:
- skip_reconciliation is not defined or skip_reconciliation == False
- _kiali_io_ossmconsole.status is defined
- _kiali_io_ossmconsole.status.specVersion is defined
- version != _kiali_io_ossmconsole.status.specVersion

- name: Determine the default supported images for all known versions
include_vars:
Expand Down
8 changes: 1 addition & 7 deletions playbooks/ossmconsole-remove.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,9 @@
set_fact:
playbook_time_start: "{{ '%Y-%m-%d %H:%M:%S' | strftime }}"

- ignore_errors: yes
name: Determine the default playbook
include_vars:
file: "default-playbook.yml"
name: default_playbook

- ignore_errors: yes
include_role:
name: "{{ version | default(default_playbook.playbook) }}/ossmconsole-remove"
name: "{{ version | default('default') }}/ossmconsole-remove"

- ignore_errors: yes
name: Playbook end time
Expand Down