diff --git a/charts/gitops-runtime/Chart.yaml b/charts/gitops-runtime/Chart.yaml index b602bacf..1929837b 100644 --- a/charts/gitops-runtime/Chart.yaml +++ b/charts/gitops-runtime/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 appVersion: 0.1.27-helm-alpha description: A Helm chart for Codefresh gitops runtime name: gitops-runtime -version: 0.2.1-alpha.2 +version: 0.2.1-alpha.3 home: https://github.com/codefresh-io/gitops-runtime-helm keywords: - codefresh @@ -13,7 +13,7 @@ maintainers: dependencies: - name: argo-cd repository: https://codefresh-io.github.io/argo-helm - version: 5.27.1-1-cap-CR-17237 + version: 5.28.1-1-cap-CR-17237 - name: argo-events repository: https://codefresh-io.github.io/argo-helm version: 2.0.5-1-cf-init diff --git a/charts/gitops-runtime/README.md b/charts/gitops-runtime/README.md index 962dcbc2..51877411 100644 --- a/charts/gitops-runtime/README.md +++ b/charts/gitops-runtime/README.md @@ -1,6 +1,6 @@ # gitops-runtime -![Version: 0.2.1-alpha.2](https://img.shields.io/badge/Version-0.2.1--alpha.2-informational?style=flat-square) ![AppVersion: 0.1.27-helm-alpha](https://img.shields.io/badge/AppVersion-0.1.27--helm--alpha-informational?style=flat-square) +![Version: 0.2.1-alpha.3](https://img.shields.io/badge/Version-0.2.1--alpha.3-informational?style=flat-square) ![AppVersion: 0.1.27-helm-alpha](https://img.shields.io/badge/AppVersion-0.1.27--helm--alpha-informational?style=flat-square) A Helm chart for Codefresh gitops runtime @@ -18,7 +18,7 @@ A Helm chart for Codefresh gitops runtime |------------|------|---------| | https://bitnami-labs.github.io/sealed-secrets/ | sealed-secrets | 2.7.3 | | https://chartmuseum.codefresh.io/codefresh-tunnel-client | tunnel-client(codefresh-tunnel-client) | 0.1.12 | -| https://codefresh-io.github.io/argo-helm | argo-cd | 5.27.1-1-cap-CR-17237 | +| https://codefresh-io.github.io/argo-helm | argo-cd | 5.28.1-1-cap-CR-17237 | | https://codefresh-io.github.io/argo-helm | argo-events | 2.0.5-1-cf-init | | https://codefresh-io.github.io/argo-helm | argo-rollouts | 2.22.1-1-cap-sw | | https://codefresh-io.github.io/argo-helm | argo-workflows | 0.22.8-1-cf-init | diff --git a/scripts/all-image-values.sh b/scripts/all-image-values.sh new file mode 100755 index 00000000..b66e25b0 --- /dev/null +++ b/scripts/all-image-values.sh @@ -0,0 +1,4 @@ +MYDIR=$(dirname $0) + +$MYDIR/output-calculated-values.sh /tmp/gitops-runtime-values.yaml > /dev/null +python3 $MYDIR/helper-scripts/yaml-filter.py /tmp/gitops-runtime-values.yaml image.repository,image.registry,image.tag,argo-events.configs.nats.versions,argo-events.configs.jetstream.versions \ No newline at end of file diff --git a/scripts/helper-scripts/yaml-filter.py b/scripts/helper-scripts/yaml-filter.py new file mode 100755 index 00000000..1e9b9a34 --- /dev/null +++ b/scripts/helper-scripts/yaml-filter.py @@ -0,0 +1,46 @@ +# Program to convert yaml file to dictionary +import yaml +import sys + +def set_nested_dict_value(nested_dict, path, value): + """Set a value in a nested dictionary using a dot-delimited path.""" + keys = path.split('.') + for key in keys[:-1]: + nested_dict = nested_dict.setdefault(key, {}) + nested_dict[keys[-1]] = value + +def recurse_filter(currValue, filteredDict, filterKeyPathList, currentPath): + bMatched = False + for filterKeyPath in filterKeyPathList: + if currentPath.endswith(filterKeyPath) and currValue: + bMatched = True + if bMatched == True: + set_nested_dict_value(filteredDict,currentPath,currValue) + elif type(currValue) is dict: + for key in currValue.keys(): + if not currentPath: + path = key + else: + path = currentPath + "." + key + recurse_filter(currValue[key], filteredDict, filterKeyPathList, path) + else: + return + +def main(yamlFilepath, filterKeys): + # Open yaml + with open(yamlFilepath, 'r') as stream: + try: + d=yaml.safe_load(stream) + except yaml.YAMLError as e: + print(e) + + filteredDict = {} + lstFilterKeys = filterKeys.split(",") + recurse_filter(d, filteredDict, lstFilterKeys, "") + print(yaml.dump(filteredDict)) + +if __name__ == "__main__": + if len(sys.argv) != 3: + raise SyntaxError("Wrong number of arguments. Usage: filter-values.py ") + else: + main(sys.argv[1], sys.argv[2]) \ No newline at end of file diff --git a/scripts/list-images-for-mirrror.sh b/scripts/list-images-for-mirrror.sh new file mode 100755 index 00000000..4382fe80 --- /dev/null +++ b/scripts/list-images-for-mirrror.sh @@ -0,0 +1,5 @@ +MYDIR=$(dirname $0) +CHARTDIR="${MYDIR}/../charts/gitops-runtime" +VALUESFILE="${CHARTDIR}/ci/ingressless-values.yaml" +helm dependency update $CHARTDIR > /dev/null +helm template --values $VALUESFILE $CHARTDIR | grep -E -i ".*Image: " | awk -F ':' '{if ($2) printf "%s:%s\n", $2, $3}' | tr -d "\"|[:blank:]" | sort -u |uniq -i \ No newline at end of file diff --git a/scripts/output-calculated-values.sh b/scripts/output-calculated-values.sh new file mode 100755 index 00000000..2957fa03 --- /dev/null +++ b/scripts/output-calculated-values.sh @@ -0,0 +1,14 @@ +#!/bin/bash +MYDIR=$(dirname $0) +CHARTDIR="${MYDIR}/../charts/gitops-runtime" +VALUESFILE="${CHARTDIR}/ci/ingressless-values.yaml" +OUTPUTFILE=$1 +ALL_VALUES_TEMPLATE=$(cat <<-END +{{ .Values | toYaml }} +END +) + +echo $ALL_VALUES_TEMPLATE > $CHARTDIR/templates/all-values.yaml +helm dependency update $CHARTDIR +helm template --values $VALUESFILE --show-only templates/all-values.yaml $CHARTDIR > $OUTPUTFILE +rm $CHARTDIR/templates/all-values.yaml \ No newline at end of file