From 5eb05a3c0b285d4085c6d5456e5e7eadac6361b7 Mon Sep 17 00:00:00 2001 From: Joshua Reed Date: Thu, 22 Feb 2024 10:12:34 -0700 Subject: [PATCH] Auto-increment chart versions Enable auto-versioning of helm charts to ensure the FluxCD helm controller recognizes chart changes. To guarantee the helm chart version is incremented when a helm chart change is submitted, the following is implemented: - Provide a top level hierarchy for helm charts to differentiate between upstream and custom charts: helm-charts/{custom,upstream} - Arrange exiting helm chart in appropriate helm-charts location. Custom for helm charts built and maintained in this repository. Upstream for directly used and/or directly used plus patched. - stx-APP-helm now contains only manifests and final application packaging rules. No custom helm charts should be delivered here. - Use StarlingX debian git revcount packaging mechanisms to derive the semver PATCH version for custom helm charts. Chart version (MAJOR.MINOR.PATCH) is passed to 'helm package' command to force the version, where PATCH == 'git revcount' - Use StarlingX debian git revcount packaging mechanisms to derive the semver BUILD version for upstream helm charts which maintains the upstream chart version and adds a versioned BUILD extension. ::= "." "." ::= "+" Chart version (MAJOR.MINOR.PATCH+STX.REV) is passed to 'helm package' command to force the version, where REV == 'git revcount' - Establish a new package(s) for the custom or upstream helm chart(s). - Enforce a baseline version for all helm charts; eg 'APP-helm'. Maintain current rev counts for all new packages, where applicable. - Update 'stx-APP-helm' to: - Update the build dependencies to include the new helm chart package and remove dependency on helm - Update the rules to remove building the dependency APP helm chart(s) and automatically update the chart versions in the FluxCD helmrelease.yaml files. Test Plan: PASS - Build all packages generating an application tarball verifying all versions on the charts and application make sense. PASS - Introduce temporary chart changes and ensure that the versions increment as expected. PASS - Validate basic application lifecycle operations: upload/apply/remove/delete. Story: 2010929 Task: 49608 Change-Id: Iaa91d6977a687f1d6ee2909fe8ed9269cd9c3574 Signed-off-by: Joshua Reed --- debian_pkg_dirs | 3 ++ .../debian/deb_folder/changelog | 5 +++ .../debian/deb_folder/control | 15 +++++++ .../debian/deb_folder/copyright | 41 +++++++++++++++++++ .../deb_folder/oidc-client-helm.install | 1 + .../oidc-client-helm/debian/deb_folder/rules | 29 +++++++++++++ .../debian/deb_folder/source/format | 1 + .../oidc-client-helm/debian/meta_data.yaml | 10 +++++ .../oidc-client-helm}/Makefile | 10 ++--- .../oidc-client-helm}/oidc-client/Chart.yaml | 0 .../oidc-client/templates/_helpers.tpl | 0 .../oidc-client/templates/configmap.yaml | 0 .../oidc-client/templates/deployment.yaml | 0 .../oidc-client/templates/ingress.yaml | 0 .../oidc-client/templates/service.yaml | 0 .../oidc-client-helm}/oidc-client/values.yaml | 0 .../debian/deb_folder/changelog | 5 +++ .../debian/deb_folder/control | 15 +++++++ .../debian/deb_folder/copyright | 41 +++++++++++++++++++ ...001-move-metadata-release-for-helmv3.patch | 2 +- .../debian/deb_folder/patches/series | 1 + .../debian/deb_folder/rules | 30 ++++++++++++++ .../deb_folder/secret-observer-helm.install | 1 + .../debian/deb_folder/source/format | 1 + .../debian/meta_data.yaml | 12 ++++++ .../secret-observer-helm/Makefile | 41 +++++++++++++++++++ .../dexidp-helm/debian/deb_folder/changelog | 5 +++ .../dexidp-helm/debian/deb_folder/control | 15 +++++++ .../dexidp-helm/debian/deb_folder/copyright | 41 +++++++++++++++++++ .../debian/deb_folder/dexidp-helm.install | 1 + ...-new-config-value-extraStaticClients.patch | 20 ++++----- .../debian/deb_folder/patches/series | 1 + .../dexidp-helm/debian/deb_folder/rules | 30 ++++++++++++++ .../debian/deb_folder/source/format | 1 + .../dexidp-helm/debian/meta_data.yaml | 15 +++++++ .../dexidp-helm/dexidp-helm/files/Makefile | 41 +++++++++++++++++++ .../debian/deb_folder/changelog | 6 +++ stx-oidc-auth-helm/debian/deb_folder/control | 4 +- stx-oidc-auth-helm/debian/deb_folder/rules | 38 +++++++++-------- stx-oidc-auth-helm/debian/meta_data.yaml | 12 +----- .../fluxcd-manifests/dex/helmrelease.yaml | 2 +- .../oidc-client/helmrelease.yaml | 2 +- .../secret-observer/helmrelease.yaml | 2 +- 43 files changed, 453 insertions(+), 47 deletions(-) create mode 100644 helm-charts/custom/oidc-client-helm/debian/deb_folder/changelog create mode 100644 helm-charts/custom/oidc-client-helm/debian/deb_folder/control create mode 100644 helm-charts/custom/oidc-client-helm/debian/deb_folder/copyright create mode 100644 helm-charts/custom/oidc-client-helm/debian/deb_folder/oidc-client-helm.install create mode 100755 helm-charts/custom/oidc-client-helm/debian/deb_folder/rules create mode 100644 helm-charts/custom/oidc-client-helm/debian/deb_folder/source/format create mode 100644 helm-charts/custom/oidc-client-helm/debian/meta_data.yaml rename {stx-oidc-auth-helm/stx-oidc-auth-helm/helm-charts => helm-charts/custom/oidc-client-helm/oidc-client-helm}/Makefile (66%) rename {stx-oidc-auth-helm/stx-oidc-auth-helm/helm-charts => helm-charts/custom/oidc-client-helm/oidc-client-helm}/oidc-client/Chart.yaml (100%) rename {stx-oidc-auth-helm/stx-oidc-auth-helm/helm-charts => helm-charts/custom/oidc-client-helm/oidc-client-helm}/oidc-client/templates/_helpers.tpl (100%) rename {stx-oidc-auth-helm/stx-oidc-auth-helm/helm-charts => helm-charts/custom/oidc-client-helm/oidc-client-helm}/oidc-client/templates/configmap.yaml (100%) rename {stx-oidc-auth-helm/stx-oidc-auth-helm/helm-charts => helm-charts/custom/oidc-client-helm/oidc-client-helm}/oidc-client/templates/deployment.yaml (100%) rename {stx-oidc-auth-helm/stx-oidc-auth-helm/helm-charts => helm-charts/custom/oidc-client-helm/oidc-client-helm}/oidc-client/templates/ingress.yaml (100%) rename {stx-oidc-auth-helm/stx-oidc-auth-helm/helm-charts => helm-charts/custom/oidc-client-helm/oidc-client-helm}/oidc-client/templates/service.yaml (100%) rename {stx-oidc-auth-helm/stx-oidc-auth-helm/helm-charts => helm-charts/custom/oidc-client-helm/oidc-client-helm}/oidc-client/values.yaml (100%) create mode 100644 helm-charts/custom/secret-observer-helm/debian/deb_folder/changelog create mode 100644 helm-charts/custom/secret-observer-helm/debian/deb_folder/control create mode 100644 helm-charts/custom/secret-observer-helm/debian/deb_folder/copyright rename {stx-oidc-auth-helm/stx-oidc-auth-helm/files => helm-charts/custom/secret-observer-helm/debian/deb_folder/patches}/0001-move-metadata-release-for-helmv3.patch (99%) create mode 100644 helm-charts/custom/secret-observer-helm/debian/deb_folder/patches/series create mode 100755 helm-charts/custom/secret-observer-helm/debian/deb_folder/rules create mode 100644 helm-charts/custom/secret-observer-helm/debian/deb_folder/secret-observer-helm.install create mode 100644 helm-charts/custom/secret-observer-helm/debian/deb_folder/source/format create mode 100644 helm-charts/custom/secret-observer-helm/debian/meta_data.yaml create mode 100644 helm-charts/custom/secret-observer-helm/secret-observer-helm/Makefile create mode 100644 helm-charts/upstream/dexidp-helm/debian/deb_folder/changelog create mode 100644 helm-charts/upstream/dexidp-helm/debian/deb_folder/control create mode 100644 helm-charts/upstream/dexidp-helm/debian/deb_folder/copyright create mode 100644 helm-charts/upstream/dexidp-helm/debian/deb_folder/dexidp-helm.install rename {stx-oidc-auth-helm/stx-oidc-auth-helm/files => helm-charts/upstream/dexidp-helm/debian/deb_folder/patches}/0001-Create-new-config-value-extraStaticClients.patch (91%) create mode 100644 helm-charts/upstream/dexidp-helm/debian/deb_folder/patches/series create mode 100644 helm-charts/upstream/dexidp-helm/debian/deb_folder/rules create mode 100644 helm-charts/upstream/dexidp-helm/debian/deb_folder/source/format create mode 100644 helm-charts/upstream/dexidp-helm/debian/meta_data.yaml create mode 100644 helm-charts/upstream/dexidp-helm/dexidp-helm/files/Makefile diff --git a/debian_pkg_dirs b/debian_pkg_dirs index 321d869..6de1096 100644 --- a/debian_pkg_dirs +++ b/debian_pkg_dirs @@ -1,3 +1,6 @@ +helm-charts/custom/oidc-client-helm +helm-charts/custom/secret-observer-helm +helm-charts/upstream/dexidp-helm oidc-auth-tools python3-k8sapp-oidc stx-oidc-auth-helm diff --git a/helm-charts/custom/oidc-client-helm/debian/deb_folder/changelog b/helm-charts/custom/oidc-client-helm/debian/deb_folder/changelog new file mode 100644 index 0000000..5b99243 --- /dev/null +++ b/helm-charts/custom/oidc-client-helm/debian/deb_folder/changelog @@ -0,0 +1,5 @@ +oidc-client-helm (0.1-1) unstable; urgency=medium + + * Initial release. + + -- Joshua Reed Tue, 21 Dec 2024 20:07:42 +0000 diff --git a/helm-charts/custom/oidc-client-helm/debian/deb_folder/control b/helm-charts/custom/oidc-client-helm/debian/deb_folder/control new file mode 100644 index 0000000..98be2e2 --- /dev/null +++ b/helm-charts/custom/oidc-client-helm/debian/deb_folder/control @@ -0,0 +1,15 @@ +Source: oidc-client-helm +Section: libs +Priority: optional +Maintainer: StarlingX Developers +Build-Depends: debhelper-compat (= 13), + helm, +Standards-Version: 4.5.1 +Homepage: https://www.starlingx.io + +Package: oidc-client-helm +Section: libs +Architecture: any +Depends: ${misc:Depends} +Description: StarlingX Platform Oidc Client helm chart + This package contains a Oidc Client helm chart. diff --git a/helm-charts/custom/oidc-client-helm/debian/deb_folder/copyright b/helm-charts/custom/oidc-client-helm/debian/deb_folder/copyright new file mode 100644 index 0000000..825fd8c --- /dev/null +++ b/helm-charts/custom/oidc-client-helm/debian/deb_folder/copyright @@ -0,0 +1,41 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: oidc-client-helm +Source: https://opendev.org/starlingx/oidc-auth-armada-app/ + +Files: * +Copyright: (c) 2019-2024 Wind River Systems, Inc +License: Apache-2 + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + . + https://www.apache.org/licenses/LICENSE-2.0 + . + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + . + On Debian-based systems the full text of the Apache version 2.0 license + can be found in `/usr/share/common-licenses/Apache-2.0'. + +# If you want to use GPL v2 or later for the /debian/* files use +# the following clauses, or change it to suit. Delete these two lines +Files: debian/* +Copyright: 2024 Wind River Systems, Inc +License: Apache-2 + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + . + https://www.apache.org/licenses/LICENSE-2.0 + . + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + . + On Debian-based systems the full text of the Apache version 2.0 license + can be found in `/usr/share/common-licenses/Apache-2.0'. diff --git a/helm-charts/custom/oidc-client-helm/debian/deb_folder/oidc-client-helm.install b/helm-charts/custom/oidc-client-helm/debian/deb_folder/oidc-client-helm.install new file mode 100644 index 0000000..8a0c6de --- /dev/null +++ b/helm-charts/custom/oidc-client-helm/debian/deb_folder/oidc-client-helm.install @@ -0,0 +1 @@ +usr/lib/helm/* diff --git a/helm-charts/custom/oidc-client-helm/debian/deb_folder/rules b/helm-charts/custom/oidc-client-helm/debian/deb_folder/rules new file mode 100755 index 0000000..76fc406 --- /dev/null +++ b/helm-charts/custom/oidc-client-helm/debian/deb_folder/rules @@ -0,0 +1,29 @@ +#!/usr/bin/make -f +# export DH_VERBOSE = 1 + +export ROOT = debian/tmp +export APP_FOLDER = $(ROOT)/usr/lib/helm + +export DEB_VERSION = $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ') +export RELEASE = $(shell echo $(DEB_VERSION) | cut -f 1 -d '-') +export REVISION = $(shell echo $(DEB_VERSION) | cut -f 4 -d '.') +export CHART_VERSION = $(RELEASE).$(REVISION) + +%: + dh $@ + +override_dh_auto_build: + + mkdir -p build + + # Copy oidc-client items. + mv Makefile oidc-client build + + # Build the chart + cd build && make CHART_VERSION=$(CHART_VERSION) oidc-client + +override_dh_auto_install: + install -d -m 755 $(APP_FOLDER) + install -p -D -m 755 build/oidc-client*.tgz $(APP_FOLDER) + +override_dh_auto_test: diff --git a/helm-charts/custom/oidc-client-helm/debian/deb_folder/source/format b/helm-charts/custom/oidc-client-helm/debian/deb_folder/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/helm-charts/custom/oidc-client-helm/debian/deb_folder/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/helm-charts/custom/oidc-client-helm/debian/meta_data.yaml b/helm-charts/custom/oidc-client-helm/debian/meta_data.yaml new file mode 100644 index 0000000..b1cac44 --- /dev/null +++ b/helm-charts/custom/oidc-client-helm/debian/meta_data.yaml @@ -0,0 +1,10 @@ +--- +debname: oidc-client-helm +debver: 0.1-0 +src_path: oidc-client-helm +revision: + dist: $STX_DIST + stx_patch: 19 + GITREVCOUNT: + SRC_DIR: ${MY_REPO}/stx/oidc-auth-armada-app/helm-charts/custom/oidc-client-helm/oidc-client-helm/oidc-client + BASE_SRCREV: 2a5db63dc246d1e2cdbc964b40e7530c035b2b1e diff --git a/stx-oidc-auth-helm/stx-oidc-auth-helm/helm-charts/Makefile b/helm-charts/custom/oidc-client-helm/oidc-client-helm/Makefile similarity index 66% rename from stx-oidc-auth-helm/stx-oidc-auth-helm/helm-charts/Makefile rename to helm-charts/custom/oidc-client-helm/oidc-client-helm/Makefile index eff605d..31ebf13 100644 --- a/stx-oidc-auth-helm/stx-oidc-auth-helm/helm-charts/Makefile +++ b/helm-charts/custom/oidc-client-helm/oidc-client-helm/Makefile @@ -1,7 +1,7 @@ # # Copyright 2017 The Openstack-Helm Authors. # -# Copyright (c) 2019 Wind River Systems, Inc. +# Copyright (c) 2019,2024 Wind River Systems, Inc. # # SPDX-License-Identifier: Apache-2.0 # @@ -9,8 +9,8 @@ SHELL := /bin/bash TASK := build -EXCLUDES := helm-toolkit doc tests tools logs tmp -CHARTS := helm-toolkit $(filter-out $(EXCLUDES), $(patsubst %/.,%,$(wildcard */.))) +EXCLUDES := doc tests tools logs tmp +CHARTS := $(filter-out $(EXCLUDES), $(patsubst %/.,%,$(wildcard */.))) .PHONY: $(EXCLUDES) $(CHARTS) @@ -25,18 +25,16 @@ $(CHARTS): init-%: if [ -f $*/Makefile ]; then make -C $*; fi - if [ -f $*/requirements.yaml ]; then helm dep up $*; fi lint-%: init-% if [ -d $* ]; then helm lint $*; fi build-%: lint-% - if [ -d $* ]; then helm package $*; fi + if [ -d $* ]; then helm package --version $(CHART_VERSION) $*; fi clean: @echo "Clean all build artifacts" rm -f */templates/_partials.tpl */templates/_globals.tpl - rm -f *tgz */charts/*tgz */requirements.lock rm -rf */charts */tmpcharts %: diff --git a/stx-oidc-auth-helm/stx-oidc-auth-helm/helm-charts/oidc-client/Chart.yaml b/helm-charts/custom/oidc-client-helm/oidc-client-helm/oidc-client/Chart.yaml similarity index 100% rename from stx-oidc-auth-helm/stx-oidc-auth-helm/helm-charts/oidc-client/Chart.yaml rename to helm-charts/custom/oidc-client-helm/oidc-client-helm/oidc-client/Chart.yaml diff --git a/stx-oidc-auth-helm/stx-oidc-auth-helm/helm-charts/oidc-client/templates/_helpers.tpl b/helm-charts/custom/oidc-client-helm/oidc-client-helm/oidc-client/templates/_helpers.tpl similarity index 100% rename from stx-oidc-auth-helm/stx-oidc-auth-helm/helm-charts/oidc-client/templates/_helpers.tpl rename to helm-charts/custom/oidc-client-helm/oidc-client-helm/oidc-client/templates/_helpers.tpl diff --git a/stx-oidc-auth-helm/stx-oidc-auth-helm/helm-charts/oidc-client/templates/configmap.yaml b/helm-charts/custom/oidc-client-helm/oidc-client-helm/oidc-client/templates/configmap.yaml similarity index 100% rename from stx-oidc-auth-helm/stx-oidc-auth-helm/helm-charts/oidc-client/templates/configmap.yaml rename to helm-charts/custom/oidc-client-helm/oidc-client-helm/oidc-client/templates/configmap.yaml diff --git a/stx-oidc-auth-helm/stx-oidc-auth-helm/helm-charts/oidc-client/templates/deployment.yaml b/helm-charts/custom/oidc-client-helm/oidc-client-helm/oidc-client/templates/deployment.yaml similarity index 100% rename from stx-oidc-auth-helm/stx-oidc-auth-helm/helm-charts/oidc-client/templates/deployment.yaml rename to helm-charts/custom/oidc-client-helm/oidc-client-helm/oidc-client/templates/deployment.yaml diff --git a/stx-oidc-auth-helm/stx-oidc-auth-helm/helm-charts/oidc-client/templates/ingress.yaml b/helm-charts/custom/oidc-client-helm/oidc-client-helm/oidc-client/templates/ingress.yaml similarity index 100% rename from stx-oidc-auth-helm/stx-oidc-auth-helm/helm-charts/oidc-client/templates/ingress.yaml rename to helm-charts/custom/oidc-client-helm/oidc-client-helm/oidc-client/templates/ingress.yaml diff --git a/stx-oidc-auth-helm/stx-oidc-auth-helm/helm-charts/oidc-client/templates/service.yaml b/helm-charts/custom/oidc-client-helm/oidc-client-helm/oidc-client/templates/service.yaml similarity index 100% rename from stx-oidc-auth-helm/stx-oidc-auth-helm/helm-charts/oidc-client/templates/service.yaml rename to helm-charts/custom/oidc-client-helm/oidc-client-helm/oidc-client/templates/service.yaml diff --git a/stx-oidc-auth-helm/stx-oidc-auth-helm/helm-charts/oidc-client/values.yaml b/helm-charts/custom/oidc-client-helm/oidc-client-helm/oidc-client/values.yaml similarity index 100% rename from stx-oidc-auth-helm/stx-oidc-auth-helm/helm-charts/oidc-client/values.yaml rename to helm-charts/custom/oidc-client-helm/oidc-client-helm/oidc-client/values.yaml diff --git a/helm-charts/custom/secret-observer-helm/debian/deb_folder/changelog b/helm-charts/custom/secret-observer-helm/debian/deb_folder/changelog new file mode 100644 index 0000000..496775b --- /dev/null +++ b/helm-charts/custom/secret-observer-helm/debian/deb_folder/changelog @@ -0,0 +1,5 @@ +secret-observer-helm (0.1-1) unstable; urgency=medium + + * Initial release. + + -- Joshua Reed Tue, 21 Dec 2024 20:07:42 +0000 diff --git a/helm-charts/custom/secret-observer-helm/debian/deb_folder/control b/helm-charts/custom/secret-observer-helm/debian/deb_folder/control new file mode 100644 index 0000000..64e6b50 --- /dev/null +++ b/helm-charts/custom/secret-observer-helm/debian/deb_folder/control @@ -0,0 +1,15 @@ +Source: secret-observer-helm +Section: libs +Priority: optional +Maintainer: StarlingX Developers +Build-Depends: debhelper-compat (= 13), + helm, +Standards-Version: 4.5.1 +Homepage: https://www.starlingx.io + +Package: secret-observer-helm +Section: libs +Architecture: any +Depends: ${misc:Depends} +Description: StarlingX Platform secret observer helm chart + This package contains a helm chart for the secret observer diff --git a/helm-charts/custom/secret-observer-helm/debian/deb_folder/copyright b/helm-charts/custom/secret-observer-helm/debian/deb_folder/copyright new file mode 100644 index 0000000..cf27e53 --- /dev/null +++ b/helm-charts/custom/secret-observer-helm/debian/deb_folder/copyright @@ -0,0 +1,41 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: secret-observer-helm +Source: https://opendev.org/starlingx/helm-charts/ + +Files: * +Copyright: (c) 2019-2024 Wind River Systems, Inc +License: Apache-2 + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + . + https://www.apache.org/licenses/LICENSE-2.0 + . + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + . + On Debian-based systems the full text of the Apache version 2.0 license + can be found in `/usr/share/common-licenses/Apache-2.0'. + +# If you want to use GPL v2 or later for the /debian/* files use +# the following clauses, or change it to suit. Delete these two lines +Files: debian/* +Copyright: 2024 Wind River Systems, Inc +License: Apache-2 + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + . + https://www.apache.org/licenses/LICENSE-2.0 + . + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + . + On Debian-based systems the full text of the Apache version 2.0 license + can be found in `/usr/share/common-licenses/Apache-2.0'. diff --git a/stx-oidc-auth-helm/stx-oidc-auth-helm/files/0001-move-metadata-release-for-helmv3.patch b/helm-charts/custom/secret-observer-helm/debian/deb_folder/patches/0001-move-metadata-release-for-helmv3.patch similarity index 99% rename from stx-oidc-auth-helm/stx-oidc-auth-helm/files/0001-move-metadata-release-for-helmv3.patch rename to helm-charts/custom/secret-observer-helm/debian/deb_folder/patches/0001-move-metadata-release-for-helmv3.patch index fc0df22..a5aeb3d 100644 --- a/stx-oidc-auth-helm/stx-oidc-auth-helm/files/0001-move-metadata-release-for-helmv3.patch +++ b/helm-charts/custom/secret-observer-helm/debian/deb_folder/patches/0001-move-metadata-release-for-helmv3.patch @@ -28,6 +28,6 @@ index 322bd73..5cf33d5 100644 imagePullSecrets: - name: default-registry-key {{- end -}} --- +-- 2.29.2 diff --git a/helm-charts/custom/secret-observer-helm/debian/deb_folder/patches/series b/helm-charts/custom/secret-observer-helm/debian/deb_folder/patches/series new file mode 100644 index 0000000..8998672 --- /dev/null +++ b/helm-charts/custom/secret-observer-helm/debian/deb_folder/patches/series @@ -0,0 +1 @@ +0001-move-metadata-release-for-helmv3.patch diff --git a/helm-charts/custom/secret-observer-helm/debian/deb_folder/rules b/helm-charts/custom/secret-observer-helm/debian/deb_folder/rules new file mode 100755 index 0000000..f373691 --- /dev/null +++ b/helm-charts/custom/secret-observer-helm/debian/deb_folder/rules @@ -0,0 +1,30 @@ +#!/usr/bin/make -f +# export DH_VERBOSE = 1 + +export ROOT = debian/tmp +export APP_FOLDER = $(ROOT)/usr/lib/helm + +export DEB_VERSION = $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ') +export RELEASE = $(shell echo $(DEB_VERSION) | cut -f 1 -d '-') +export REVISION = $(shell echo $(DEB_VERSION) | cut -f 4 -d '.') +export CHART_VERSION = $(RELEASE).$(REVISION) + +%: + dh $@ + +override_dh_auto_build: + + mkdir -p build + + mv helm-charts build + mv Makefile build/helm-charts + + # Patch & Build the chart + cd build/helm-charts && make CHART_VERSION=$(CHART_VERSION) secret-observer + + +override_dh_auto_install: + install -d -m 755 $(APP_FOLDER) + install -p -D -m 755 build/helm-charts/secret-observer*.tgz $(APP_FOLDER) + +override_dh_auto_test: diff --git a/helm-charts/custom/secret-observer-helm/debian/deb_folder/secret-observer-helm.install b/helm-charts/custom/secret-observer-helm/debian/deb_folder/secret-observer-helm.install new file mode 100644 index 0000000..8a0c6de --- /dev/null +++ b/helm-charts/custom/secret-observer-helm/debian/deb_folder/secret-observer-helm.install @@ -0,0 +1 @@ +usr/lib/helm/* diff --git a/helm-charts/custom/secret-observer-helm/debian/deb_folder/source/format b/helm-charts/custom/secret-observer-helm/debian/deb_folder/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/helm-charts/custom/secret-observer-helm/debian/deb_folder/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/helm-charts/custom/secret-observer-helm/debian/meta_data.yaml b/helm-charts/custom/secret-observer-helm/debian/meta_data.yaml new file mode 100644 index 0000000..500b15d --- /dev/null +++ b/helm-charts/custom/secret-observer-helm/debian/meta_data.yaml @@ -0,0 +1,12 @@ +--- +debname: secret-observer-helm +debver: 0.1-1 +src_path: secret-observer-helm +src_files: + - ${MY_REPO}/stx/helm-charts/secret-observer/secret-observer/helm-charts +revision: + dist: $STX_DIST + GITREVCOUNT: + stx_patch: 1 + SRC_DIR: ${MY_REPO}/stx/oidc-auth-armada-app/helm-charts/custom/secret-observer-helm/secret-observer-helm + BASE_SRCREV: 2a5db63dc246d1e2cdbc964b40e7530c035b2b1e diff --git a/helm-charts/custom/secret-observer-helm/secret-observer-helm/Makefile b/helm-charts/custom/secret-observer-helm/secret-observer-helm/Makefile new file mode 100644 index 0000000..31ebf13 --- /dev/null +++ b/helm-charts/custom/secret-observer-helm/secret-observer-helm/Makefile @@ -0,0 +1,41 @@ +# +# Copyright 2017 The Openstack-Helm Authors. +# +# Copyright (c) 2019,2024 Wind River Systems, Inc. +# +# SPDX-License-Identifier: Apache-2.0 +# +# It's necessary to set this because some environments don't link sh -> bash. +SHELL := /bin/bash +TASK := build + +EXCLUDES := doc tests tools logs tmp +CHARTS := $(filter-out $(EXCLUDES), $(patsubst %/.,%,$(wildcard */.))) + +.PHONY: $(EXCLUDES) $(CHARTS) + +all: $(CHARTS) + +$(CHARTS): + @if [ -d $@ ]; then \ + echo; \ + echo "===== Processing [$@] chart ====="; \ + make $(TASK)-$@; \ + fi + +init-%: + if [ -f $*/Makefile ]; then make -C $*; fi + +lint-%: init-% + if [ -d $* ]; then helm lint $*; fi + +build-%: lint-% + if [ -d $* ]; then helm package --version $(CHART_VERSION) $*; fi + +clean: + @echo "Clean all build artifacts" + rm -f */templates/_partials.tpl */templates/_globals.tpl + rm -rf */charts */tmpcharts + +%: + @: diff --git a/helm-charts/upstream/dexidp-helm/debian/deb_folder/changelog b/helm-charts/upstream/dexidp-helm/debian/deb_folder/changelog new file mode 100644 index 0000000..e474cf8 --- /dev/null +++ b/helm-charts/upstream/dexidp-helm/debian/deb_folder/changelog @@ -0,0 +1,5 @@ +dexidp-helm (0.15-3) unstable; urgency=medium + + * Initial release of wrapped dexidp v0.15.3 + + -- Joshua Reed Tue, 21 Dec 2024 20:07:42 +0000 diff --git a/helm-charts/upstream/dexidp-helm/debian/deb_folder/control b/helm-charts/upstream/dexidp-helm/debian/deb_folder/control new file mode 100644 index 0000000..e64115b --- /dev/null +++ b/helm-charts/upstream/dexidp-helm/debian/deb_folder/control @@ -0,0 +1,15 @@ +Source: dexidp-helm +Section: libs +Priority: optional +Maintainer: StarlingX Developers +Build-Depends: debhelper-compat (= 13), + helm +Standards-Version: 4.5.1 +Homepage: https://www.starlingx.io + +Package: dexidp-helm +Section: libs +Architecture: any +Depends: ${misc:Depends} +Description: StarlingX DEX Helm Charts + This package contains helm charts for the upstream DEX application. diff --git a/helm-charts/upstream/dexidp-helm/debian/deb_folder/copyright b/helm-charts/upstream/dexidp-helm/debian/deb_folder/copyright new file mode 100644 index 0000000..0dabbbf --- /dev/null +++ b/helm-charts/upstream/dexidp-helm/debian/deb_folder/copyright @@ -0,0 +1,41 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: dexidp-helm +Source: https://github.com/dexidp + +Files: * +Copyright: (c) 2024 Wind River Systems, Inc +License: Apache-2 + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + . + https://www.apache.org/licenses/LICENSE-2.0 + . + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + . + On Debian-based systems the full text of the Apache version 2.0 license + can be found in `/usr/share/common-licenses/Apache-2.0'. + +# If you want to use GPL v2 or later for the /debian/* files use +# the following clauses, or change it to suit. Delete these two lines +Files: debian/* +Copyright: 2024 Wind River Systems, Inc +License: Apache-2 + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + . + https://www.apache.org/licenses/LICENSE-2.0 + . + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + . + On Debian-based systems the full text of the Apache version 2.0 license + can be found in `/usr/share/common-licenses/Apache-2.0'. diff --git a/helm-charts/upstream/dexidp-helm/debian/deb_folder/dexidp-helm.install b/helm-charts/upstream/dexidp-helm/debian/deb_folder/dexidp-helm.install new file mode 100644 index 0000000..8a0c6de --- /dev/null +++ b/helm-charts/upstream/dexidp-helm/debian/deb_folder/dexidp-helm.install @@ -0,0 +1 @@ +usr/lib/helm/* diff --git a/stx-oidc-auth-helm/stx-oidc-auth-helm/files/0001-Create-new-config-value-extraStaticClients.patch b/helm-charts/upstream/dexidp-helm/debian/deb_folder/patches/0001-Create-new-config-value-extraStaticClients.patch similarity index 91% rename from stx-oidc-auth-helm/stx-oidc-auth-helm/files/0001-Create-new-config-value-extraStaticClients.patch rename to helm-charts/upstream/dexidp-helm/debian/deb_folder/patches/0001-Create-new-config-value-extraStaticClients.patch index d019fe6..97b3e12 100644 --- a/stx-oidc-auth-helm/stx-oidc-auth-helm/files/0001-Create-new-config-value-extraStaticClients.patch +++ b/helm-charts/upstream/dexidp-helm/debian/deb_folder/patches/0001-Create-new-config-value-extraStaticClients.patch @@ -19,14 +19,14 @@ values.yaml. Signed-off-by: Michel Thebeau Signed-off-by: Joao Victor Portal --- - dex/templates/secret.yaml | 67 +++++++++++++++++++++++++++++++++++++-- - dex/values.yaml | 13 ++++++++ + templates/secret.yaml | 67 +++++++++++++++++++++++++++++++++++++-- + values.yaml | 13 ++++++++ 2 files changed, 78 insertions(+), 2 deletions(-) -diff --git a/dex/templates/secret.yaml b/dex/templates/secret.yaml +diff --git a/templates/secret.yaml b/templates/secret.yaml index 27d3954..24f694a 100644 ---- a/dex/templates/secret.yaml -+++ b/dex/templates/secret.yaml +--- a/templates/secret.yaml ++++ b/templates/secret.yaml @@ -6,6 +6,69 @@ metadata: labels: {{- include "dex.labels" . | nindent 4 }} @@ -99,14 +99,14 @@ index 27d3954..24f694a 100644 + {{- end }} + {{- end }} {{- end }} -diff --git a/dex/values.yaml b/dex/values.yaml +diff --git a/values.yaml b/values.yaml index 756d49e..34ebf1b 100644 ---- a/dex/values.yaml -+++ b/dex/values.yaml +--- a/values.yaml ++++ b/values.yaml @@ -55,6 +55,19 @@ configSecret: # See the [official documentation](https://dexidp.io/docs/). config: {} - + +# Addendum for config: +# -- extraStaticClients +# if config.extraStaticClients is present it will be added to @@ -123,6 +123,6 @@ index 756d49e..34ebf1b 100644 # -- Additional storage [volumes](https://kubernetes.io/docs/concepts/storage/volumes/). # See the [API reference](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#volumes-1) for details. volumes: [] --- +-- 2.17.1 diff --git a/helm-charts/upstream/dexidp-helm/debian/deb_folder/patches/series b/helm-charts/upstream/dexidp-helm/debian/deb_folder/patches/series new file mode 100644 index 0000000..3018f71 --- /dev/null +++ b/helm-charts/upstream/dexidp-helm/debian/deb_folder/patches/series @@ -0,0 +1 @@ +0001-Create-new-config-value-extraStaticClients.patch diff --git a/helm-charts/upstream/dexidp-helm/debian/deb_folder/rules b/helm-charts/upstream/dexidp-helm/debian/deb_folder/rules new file mode 100644 index 0000000..a2f32b4 --- /dev/null +++ b/helm-charts/upstream/dexidp-helm/debian/deb_folder/rules @@ -0,0 +1,30 @@ +#!/usr/bin/make -f +# export DH_VERBOSE = 1 + +export DEB_VERSION = $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ') +export PATCH_VERSION = $(shell echo $(DEB_VERSION) | cut -f 4 -d '.') +export CHART_BASE_VERSION = $(shell echo $(DEB_VERSION) | sed 's/-/./' | cut -d '.' -f 1-3) +export CHART_VERSION = $(CHART_BASE_VERSION)+STX.$(PATCH_VERSION) + +export ROOT = debian/tmp +export APP_FOLDER = $(ROOT)/usr/lib/helm + +%: + dh $@ + +override_dh_auto_build: + + mkdir -p build/dex + + mv *.yaml build/dex + mv Makefile build + mv templates ci README.md LICENSE build/dex + + cd build && make CHART_VERSION=$(CHART_VERSION) dex + +override_dh_auto_install: + # Install the app tar file. + install -d -m 755 $(APP_FOLDER) + install -p -D -m 755 build/dex*.tgz $(APP_FOLDER) + +override_dh_auto_test: diff --git a/helm-charts/upstream/dexidp-helm/debian/deb_folder/source/format b/helm-charts/upstream/dexidp-helm/debian/deb_folder/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/helm-charts/upstream/dexidp-helm/debian/deb_folder/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/helm-charts/upstream/dexidp-helm/debian/meta_data.yaml b/helm-charts/upstream/dexidp-helm/debian/meta_data.yaml new file mode 100644 index 0000000..badd3de --- /dev/null +++ b/helm-charts/upstream/dexidp-helm/debian/meta_data.yaml @@ -0,0 +1,15 @@ +--- +debname: dexidp-helm +debver: 0.15-3 +dl_path: + name: dex-0.15.3.tgz + url: https://github.com/dexidp/helm-charts/releases/download/dex-0.15.3/dex-0.15.3.tgz + sha256sum: 8100ba92ee85ee1b25298bcf9ea72f09a004ef502e43f38e45bf793cae5b88f3 +src_files: + - dexidp-helm/files/Makefile +revision: + dist: $STX_DIST + stx_patch: 1 + GITREVCOUNT: + BASE_SRCREV: 2a5db63dc246d1e2cdbc964b40e7530c035b2b1e + SRC_DIR: ${MY_REPO}/stx/oidc-auth-armada-app/helm-charts/upstream/dexidp-helm diff --git a/helm-charts/upstream/dexidp-helm/dexidp-helm/files/Makefile b/helm-charts/upstream/dexidp-helm/dexidp-helm/files/Makefile new file mode 100644 index 0000000..31ebf13 --- /dev/null +++ b/helm-charts/upstream/dexidp-helm/dexidp-helm/files/Makefile @@ -0,0 +1,41 @@ +# +# Copyright 2017 The Openstack-Helm Authors. +# +# Copyright (c) 2019,2024 Wind River Systems, Inc. +# +# SPDX-License-Identifier: Apache-2.0 +# +# It's necessary to set this because some environments don't link sh -> bash. +SHELL := /bin/bash +TASK := build + +EXCLUDES := doc tests tools logs tmp +CHARTS := $(filter-out $(EXCLUDES), $(patsubst %/.,%,$(wildcard */.))) + +.PHONY: $(EXCLUDES) $(CHARTS) + +all: $(CHARTS) + +$(CHARTS): + @if [ -d $@ ]; then \ + echo; \ + echo "===== Processing [$@] chart ====="; \ + make $(TASK)-$@; \ + fi + +init-%: + if [ -f $*/Makefile ]; then make -C $*; fi + +lint-%: init-% + if [ -d $* ]; then helm lint $*; fi + +build-%: lint-% + if [ -d $* ]; then helm package --version $(CHART_VERSION) $*; fi + +clean: + @echo "Clean all build artifacts" + rm -f */templates/_partials.tpl */templates/_globals.tpl + rm -rf */charts */tmpcharts + +%: + @: diff --git a/stx-oidc-auth-helm/debian/deb_folder/changelog b/stx-oidc-auth-helm/debian/deb_folder/changelog index dec5d9c..b435351 100644 --- a/stx-oidc-auth-helm/debian/deb_folder/changelog +++ b/stx-oidc-auth-helm/debian/deb_folder/changelog @@ -1,3 +1,9 @@ +stx-oidc-auth-helm (1.0-2) unstable; urgency=medium + + * Update package to split helm charts into individual packages. + + -- Joshua Reed Thu, 22 Feb 2024 10:50:42 +0000 + stx-oidc-auth-helm (1.0-1) unstable; urgency=medium * Initial release. diff --git a/stx-oidc-auth-helm/debian/deb_folder/control b/stx-oidc-auth-helm/debian/deb_folder/control index 29563d8..0b39cef 100644 --- a/stx-oidc-auth-helm/debian/deb_folder/control +++ b/stx-oidc-auth-helm/debian/deb_folder/control @@ -4,7 +4,9 @@ Priority: optional Maintainer: StarlingX Developers Build-Depends: debhelper-compat (= 13), helm, - python3-k8sapp-oidc, + oidc-client-helm, + secret-observer-helm, + dexidp-helm, python3-k8sapp-oidc-wheels, build-info Standards-Version: 4.5.1 diff --git a/stx-oidc-auth-helm/debian/deb_folder/rules b/stx-oidc-auth-helm/debian/deb_folder/rules index 28fdd4f..1aacd8d 100755 --- a/stx-oidc-auth-helm/debian/deb_folder/rules +++ b/stx-oidc-auth-helm/debian/deb_folder/rules @@ -15,40 +15,44 @@ export APP_TARBALL = $(APP_NAME)-$(APP_VERSION).tgz export HELM_FOLDER = /usr/lib/helm export HELM_REPO = stx-platform export STAGING = staging -export DEX_TAR_NAME = dex-0.15.3.tgz %: dh $@ override_dh_auto_build: - # patch secret-observer - patch -p1 < files/0001-move-metadata-release-for-helmv3.patch - # Create the TGZ file. - cd helm-charts && make oidc-client - cd helm-charts && make secret-observer - # patch the dex chart - tar xf ${DEX_TAR_NAME} - rm ${DEX_TAR_NAME} - patch -p1 < files/0001-Create-new-config-value-extraStaticClients.patch - find dex -type f -print0 | xargs -0 tar zcf ${DEX_TAR_NAME} - rm -r dex + # Setup the staging directory. mkdir -p $(STAGING) cp files/metadata.yaml $(STAGING) + cp -Rv fluxcd-manifests $(STAGING) mkdir -p $(STAGING)/charts - cp helm-charts/*.tgz $(STAGING)/charts - cp dex*.tgz $(STAGING)/charts - cp -R fluxcd-manifests $(STAGING) + cp /usr/lib/helm/*.tgz $(STAGING)/charts + + # Adjust the helmrelease yamls based on the chart versions + for c in $(STAGING)/charts/*; do \ + chart=$$(basename $$c .tgz); \ + chart_name=$${chart%-*}; \ + chart_version=$${chart##*-}; \ + echo "Found $$chart; name: $$chart_name, version: $$chart_version"; \ + chart_manifest=$$(find $(STAGING)/fluxcd-manifests -name helmrelease.yaml -exec grep -q "chart:.*$$chart_name" {} \; -print); \ + echo "Updating manifest: $$chart_manifest with chart version: $$chart_version"; \ + sed -i "s/REPLACE_HELM_CHART_VERSION/$$chart_version/g" $$chart_manifest; \ + grep version $$chart_manifest; \ + done + # Populate metadata. sed -i 's/APP_REPLACE_NAME/$(APP_NAME)/g' $(STAGING)/metadata.yaml sed -i 's/APP_REPLACE_VERSION/$(APP_VERSION)/g' $(STAGING)/metadata.yaml sed -i 's/HELM_REPLACE_REPO/$(HELM_REPO)/g' $(STAGING)/metadata.yaml + # Copy the plugins: installed in the buildroot mkdir -p $(STAGING)/plugins cp /plugins/*.whl $(STAGING)/plugins + # Create the app package. cd $(STAGING) && find . -type f ! -name '*.md5' -print0 | xargs -0 md5sum > checksum.md5 tar cfz $(APP_TARBALL) -C $(STAGING)/ . + # Cleanup staging rm -rf $(STAGING) @@ -58,4 +62,6 @@ override_dh_auto_install: install -p -D -m 755 $(APP_TARBALL) $(APP_FOLDER) install -d -m 750 $(BACKUP_FOLDER) -override_dh_usrlocal: +override_dh_auto_test: + +override_dh_usrlocal: \ No newline at end of file diff --git a/stx-oidc-auth-helm/debian/meta_data.yaml b/stx-oidc-auth-helm/debian/meta_data.yaml index 355a5df..0e87d00 100644 --- a/stx-oidc-auth-helm/debian/meta_data.yaml +++ b/stx-oidc-auth-helm/debian/meta_data.yaml @@ -1,18 +1,10 @@ --- debname: stx-oidc-auth-helm -debver: 1.0-1 +debver: 1.0-2 src_path: stx-oidc-auth-helm -src_files: - - ${MY_REPO}/stx/helm-charts/secret-observer/secret-observer/helm-charts -dl_files: - dex-0.15.3.tgz: - topdir: null - url: https://github.com/dexidp/helm-charts/releases/download/dex-0.15.3/dex-0.15.3.tgz - sha256sum: 8100ba92ee85ee1b25298bcf9ea72f09a004ef502e43f38e45bf793cae5b88f3 revision: dist: $STX_DIST - FILES_GITREVCOUNT: - - 638dc8f9242b0b65afed7c54c6ddc5f60744ab97 + stx_patch: 6 GITREVCOUNT: SRC_DIR: ${MY_REPO}/stx/oidc-auth-armada-app BASE_SRCREV: f045d574f30a3fa5cb555fe805a7a16244091c79 diff --git a/stx-oidc-auth-helm/stx-oidc-auth-helm/fluxcd-manifests/dex/helmrelease.yaml b/stx-oidc-auth-helm/stx-oidc-auth-helm/fluxcd-manifests/dex/helmrelease.yaml index 3005437..ac9e468 100644 --- a/stx-oidc-auth-helm/stx-oidc-auth-helm/fluxcd-manifests/dex/helmrelease.yaml +++ b/stx-oidc-auth-helm/stx-oidc-auth-helm/fluxcd-manifests/dex/helmrelease.yaml @@ -15,7 +15,7 @@ spec: chart: spec: chart: dex - version: 0.15.3 + version: REPLACE_HELM_CHART_VERSION sourceRef: kind: HelmRepository name: stx-platform diff --git a/stx-oidc-auth-helm/stx-oidc-auth-helm/fluxcd-manifests/oidc-client/helmrelease.yaml b/stx-oidc-auth-helm/stx-oidc-auth-helm/fluxcd-manifests/oidc-client/helmrelease.yaml index 66a1097..e6fec3e 100644 --- a/stx-oidc-auth-helm/stx-oidc-auth-helm/fluxcd-manifests/oidc-client/helmrelease.yaml +++ b/stx-oidc-auth-helm/stx-oidc-auth-helm/fluxcd-manifests/oidc-client/helmrelease.yaml @@ -15,7 +15,7 @@ spec: chart: spec: chart: oidc-client - version: 0.1.1 + version: REPLACE_HELM_CHART_VERSION sourceRef: kind: HelmRepository name: stx-platform diff --git a/stx-oidc-auth-helm/stx-oidc-auth-helm/fluxcd-manifests/secret-observer/helmrelease.yaml b/stx-oidc-auth-helm/stx-oidc-auth-helm/fluxcd-manifests/secret-observer/helmrelease.yaml index b52b909..e90ff7b 100644 --- a/stx-oidc-auth-helm/stx-oidc-auth-helm/fluxcd-manifests/secret-observer/helmrelease.yaml +++ b/stx-oidc-auth-helm/stx-oidc-auth-helm/fluxcd-manifests/secret-observer/helmrelease.yaml @@ -15,7 +15,7 @@ spec: chart: spec: chart: secret-observer - version: 0.1.1 + version: REPLACE_HELM_CHART_VERSION sourceRef: kind: HelmRepository name: stx-platform