-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove role 1.89 and add role 2.1 from default (#839)
* Remove role 1.89 and add role 2.1 from default * Actualizar kiali-default-supported-images.yml Co-authored-by: John Mazzitelli <[email protected]> * Update playbooks/ossmconsole-default-supported-images.yml Co-authored-by: John Mazzitelli <[email protected]> --------- Co-authored-by: John Mazzitelli <[email protected]>
- Loading branch information
1 parent
ce98b40
commit 9bc49fb
Showing
76 changed files
with
369 additions
and
380 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
default: {"imageName": "quay.io/kiali/ossmconsole", "imageVersion": "operator_version"} | ||
v1.89: {"imageName": "quay.io/kiali/ossmconsole", "imageVersion": "v1.89"} | ||
v2.1: {"imageName": "quay.io/kiali/ossmconsole", "imageVersion": "v2.1"} | ||
v1.73: {"imageName": "quay.io/kiali/ossmconsole", "imageVersion": "v1.73"} |
34 changes: 0 additions & 34 deletions
34
roles/v1.89/kiali-deploy/filter_plugins/only_accessible_namespaces.py
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
roles/v1.89/kiali-deploy/templates/kubernetes/role-controlplane.yaml
This file was deleted.
Oops, something went wrong.
14 changes: 0 additions & 14 deletions
14
roles/v1.89/kiali-deploy/templates/kubernetes/rolebinding-controlplane.yaml
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
roles/v1.89/kiali-deploy/templates/openshift/role-controlplane.yaml
This file was deleted.
Oops, something went wrong.
14 changes: 0 additions & 14 deletions
14
roles/v1.89/kiali-deploy/templates/openshift/rolebinding-controlplane.yaml
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
110 changes: 110 additions & 0 deletions
110
roles/v2.1/kiali-deploy/filter_plugins/parse_selectors.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
from __future__ import (absolute_import, division, print_function) | ||
__metaclass__ = type | ||
|
||
from ansible.errors import AnsibleFilterError | ||
|
||
ANSIBLE_METADATA = { | ||
'metadata_version': '1.1', | ||
'status': ['preview'], | ||
'supported_by': 'community' | ||
} | ||
|
||
# Given a list of label selectors in the standard k8s format, convert to the format that the k8s ansible collection wants. | ||
# For example, given this input: | ||
# - matchLabels: | ||
# foo: bar | ||
# - matchLabels: | ||
# color: blue | ||
# matchExpressions: | ||
# - key: region | ||
# operator: In | ||
# values: | ||
# - east | ||
# - west | ||
# an array will be returned with two items. | ||
# The first is a list with one item that is "foo=bar". | ||
# The second is a list with two items. The first item being "color=blue" and the second item being "region in (east, west)" | ||
# | ||
# See: | ||
# * https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors | ||
# * https://docs.ansible.com/ansible/latest/collections/kubernetes/core/k8s_info_module.html#parameter-label_selectors | ||
def parse_selectors(value): | ||
# these are the selectors that should be OR'ed together - this is the final result returned back from this function | ||
selectorOr = [] | ||
selectorOrIndex = 0 | ||
|
||
# for each item in the selectors list, there can be one matchLabels and one matchExpressions (both can be there, or just one of them). | ||
for selectors in value: | ||
selectorOr.append([]) | ||
|
||
# process the matchLabels (or matchLabels) - each results in "labelName=labelValue" strings | ||
matchLabelsString = "matchLabels" | ||
if matchLabelsString in selectors: | ||
if (selectors[matchLabelsString] is None) or (len(selectors[matchLabelsString]) == 0): | ||
raise AnsibleFilterError("Selector matchLabels is empty") | ||
for k, v in selectors[matchLabelsString].items(): | ||
expr = k + "=" + v | ||
selectorOr[selectorOrIndex].append(expr) | ||
|
||
# process the matchExpressions - each results in something like "labelName notin (labelValue, labelValue2)" | ||
matchExpressionsString = "matchExpressions" | ||
if matchExpressionsString in selectors: | ||
for me in selectors[matchExpressionsString]: | ||
if "key" not in me: | ||
raise AnsibleFilterError("Selector matchExpression is missing 'key'") | ||
key = me["key"] | ||
|
||
if "operator" not in me: | ||
raise AnsibleFilterError("Selector matchExpression is missing 'operator'") | ||
operator = me["operator"].lower() | ||
|
||
if (operator == "in" or operator == "notin") and ("values" not in me or me["values"] is None or (len(me["values"]) == 0)): | ||
raise AnsibleFilterError("Selector matchExpression is missing a non-empty 'values'") | ||
values = me["values"] if "values" in me else [] | ||
valuesStr = "(" | ||
for i, v in enumerate(values): | ||
if i > 0: | ||
valuesStr += "," | ||
valuesStr += v | ||
valuesStr += ")" | ||
|
||
if operator == "in": | ||
selectorOr[selectorOrIndex].append(key + " in " + valuesStr) | ||
elif operator == "notin": | ||
selectorOr[selectorOrIndex].append(key + " notin " + valuesStr) | ||
elif operator == "exists": | ||
selectorOr[selectorOrIndex].append(key) | ||
elif operator == "doesnotexist": | ||
selectorOr[selectorOrIndex].append("!" + key) | ||
else: | ||
raise AnsibleFilterError("Selector matchExpression has invalid operator: " + operator) | ||
|
||
selectorOrIndex = selectorOrIndex + 1 | ||
|
||
return selectorOr | ||
|
||
# ---- Ansible filters ---- | ||
class FilterModule(object): | ||
def filters(self): | ||
return { | ||
'parse_selectors': parse_selectors | ||
} | ||
|
||
# TEST | ||
# first = { | ||
# "matchLabels": { "sport": "football", "region": "west" }, | ||
# "matchExpressions": [{ "key": "region", "operator": "In", "values": ["east" ]}, { "key": "sport", "operator": "Exists"}] | ||
# } | ||
# second = { | ||
# "matchLabels": { "region": "east", "sport": "golf" }, | ||
# } | ||
# third = { | ||
# "matchExpressions": [{ "key": "sport", "operator": "In", "values": ["baseball", "football" ]},{ "key": "region", "operator": "NotIn", "values": ["east" ]}] | ||
# } | ||
# fourth = { | ||
# "matchExpressions": [{ "key": "sport", "operator": "NotIn", "values": ["baseball", "football" ]},{ "key": "region", "operator": "Exists"},{ "key": "foo", "operator": "DoesNotExist"}] | ||
# } | ||
# print ("\n=====The following should be successful:\n") | ||
# print (parse_selectors([first, second, third, fourth])) | ||
# print ("\n=====The following should result in an error:\n") | ||
# print (parse_selectors([{"matchExpressions": [{ "key": "sport", "operator": "XIn"}]}])) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.