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

Remove role 1.89 and add role 2.1 from default #839

Merged
merged 3 commits into from
Nov 11, 2024
Merged
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
12 changes: 6 additions & 6 deletions manifests/kiali-ossm/manifests/kiali.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -315,19 +315,19 @@ spec:
- name: WATCHES_FILE
value: "watches-os.yaml"
- name: RELATED_IMAGE_kiali_default
value: "${KIALI_1_89}"
- name: RELATED_IMAGE_kiali_v1_89
value: "${KIALI_1_89}"
value: "${KIALI_2_1}"
- name: RELATED_IMAGE_kiali_v2_1
value: "${KIALI_2_1}"
- name: RELATED_IMAGE_kiali_v1_73
value: "${KIALI_1_73}"
- name: RELATED_IMAGE_kiali_v1_65
value: "${KIALI_1_65}"
- name: RELATED_IMAGE_kiali_v1_57
value: "${KIALI_1_57}"
- name: RELATED_IMAGE_ossmconsole_default
value: "${OSSMCONSOLE_1_89}"
- name: RELATED_IMAGE_ossmconsole_v1_89
value: "${OSSMCONSOLE_1_89}"
value: "${OSSMCONSOLE_2_1}"
- name: RELATED_IMAGE_ossmconsole_v2_1
value: "${OSSMCONSOLE_2_1}"
- name: RELATED_IMAGE_ossmconsole_v1_73
value: "${OSSMCONSOLE_1_73}"
ports:
Expand Down
2 changes: 1 addition & 1 deletion playbooks/kiali-default-supported-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ default: {"image_name": "quay.io/kiali/kiali", "image_version": "operator_versio
v1.57: {"image_name": "quay.io/kiali/kiali", "image_version": "v1.57"}
v1.65: {"image_name": "quay.io/kiali/kiali", "image_version": "v1.65"}
v1.73: {"image_name": "quay.io/kiali/kiali", "image_version": "v1.73"}
v1.89: {"image_name": "quay.io/kiali/kiali", "image_version": "v1.89"}
v2.1: {"image_name": "quay.io/kiali/kiali", "image_version": "v2.1"}
2 changes: 1 addition & 1 deletion playbooks/ossmconsole-default-supported-images.yml
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"}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,6 @@ kiali_defaults:
annotation: "kiali.io/api-spec"
icon_annotation: "kiali.io/api-type"

api:
namespaces:
exclude:
- "^istio-operator"
- "^kube-.*"
- "^openshift.*"
- "^ibm.*"
- "^kiali-operator"
include: []
label_selector_exclude: ""
#label_selector_include:

auth:
openid:
additional_request_params: {}
Expand Down Expand Up @@ -61,15 +49,16 @@ kiali_defaults:
custom_dashboards: []

deployment:
accessible_namespaces: ["**"]
#additional_service_yaml:
affinity:
node: {}
pod: {}
pod_anti: {}
#cluster_wide_access:
cluster_wide_access: true
configmap_annotations: {}
custom_envs: []
custom_secrets: []
discovery_selectors: {}
dns:
config: {}
policy: ""
Expand Down Expand Up @@ -108,6 +97,8 @@ kiali_defaults:
version_label: ""
view_only_mode: false

extensions: []

external_services:
custom_dashboards:
discovery_auto_threshold: 10
Expand Down Expand Up @@ -159,10 +150,10 @@ kiali_defaults:
- name: "Istio Performance Dashboard"
- name: "Istio Wasm Extension Dashboard"
enabled: true
external_url: ""
health_check_url: ""
#in_cluster_url
#internal_url
is_core: false
url: ""
istio:
component_status:
enabled: true
Expand Down Expand Up @@ -212,9 +203,10 @@ kiali_defaults:
username: ""
custom_headers: {}
enabled: false
external_url: ""
grpc_port: 9095
health_check_url: ""
in_cluster_url: ""
internal_url: ""
is_core: false
namespace_selector: true
provider: "jaeger"
Expand All @@ -223,7 +215,7 @@ kiali_defaults:
tempo_config:
datasource_uid: ""
org_id: ""
url: ""
url_format: ""
use_grpc: true
whitelist_istio_system: ["jaeger-query", "istio-ingressgateway"]

Expand All @@ -243,11 +235,6 @@ kiali_defaults:
version_label_name: "version"

kiali_feature_flags:
certificates_information_indicators:
enabled: true
secrets:
- cacerts
- istio-ca-secret
disabled_features: []
istio_annotation_action: true
istio_injection_action: true
Expand Down
110 changes: 110 additions & 0 deletions roles/v2.1/kiali-deploy/filter_plugins/parse_selectors.py
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"}]}]))
Loading