Skip to content

Commit

Permalink
test: update bitnami Helm charts to use OCI package
Browse files Browse the repository at this point in the history
Per
https://blog.bitnami.com/2023/04/httpsblog.bitnami.com202304bitnami-helm-charts-now-oci.html,
Bitnami Helm charts are now GA as OCI packages. This commit updates its
repo URL to use the OCI package, which fixes the `helm pull` error:
```
KNV1068: failed to run kustomize build in /repo/source/.worktrees/b2c6bf5708654b1c2b7fbd898b48ca206de5a47b/helm-components, stdout: : # Warning: 'commonLabels' is deprecated. Please use 'labels' instead. Run 'kustomize edit fix' to update your Kustomization automatically.
                Error: Error: looks like "https://charts.bitnami.com/bitnami" is not a valid chart repository or cannot be reached: Get "https://charts.bitnami.com/bitnami/index.yaml": dial tcp: lookup charts.bitnami.com on 10.66.32.10:53: server misbehaving
                : unable to run: 'helm pull --untar --untardir /repo/source/.worktrees/b2c6bf5708654b1c2b7fbd898b48ca206de5a47b/helm-components/charts/wordpress-15.2.35 --repo https://charts.bitnami.com/bitnami wordpress --version 15.2.35' with env=[HELM_CONFIG_HOME=/tmp/kustomize-helm-1930457181/helm HELM_CACHE_HOME=/tmp/kustomize-helm-1930457181/helm/.cache HELM_DATA_HOME=/tmp/kustomize-helm-1930457181/helm/.data] (is 'helm' installed?): exit status 1
```

Link: https://oss.gprow.dev/view/gs/oss-prow-build-kpt-config-sync/logs/kpt-config-sync-standard-regular-csr/1868596976711372800

It also replaces the deprecated `commonLabels` with `labels` to suppress
the warning.
  • Loading branch information
nan-yu committed Dec 17, 2024
1 parent 478b45e commit 8dece8c
Show file tree
Hide file tree
Showing 15 changed files with 87 additions and 29 deletions.
19 changes: 19 additions & 0 deletions Makefile.oss.prow
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,25 @@ push-test-oci-images-public: "$(CRANE)"
cd $(KUSTOMIZE_COMPONENTS_DIR) && crane append -f <(tar -f - -c .) -t $(KUSTOMIZE_COMPONENTS_PUBLIC_GCR_IMAGE)
cd $(KUSTOMIZE_COMPONENTS_DIR) && crane append -f <(tar -f - -c .) -t $(KUSTOMIZE_COMPONENTS_PUBLIC_AR_IMAGE)

WORDPRESS_HELM_CHART_NAME := wordpress-helm-chart
WORDPRESS_HELM_CHART_VERSION := 15.2.35
WORDPRESS_HELM_CHART_SOURCE_REPO := oci://registry-1.docker.io/bitnamicharts/wordpress
WORDPRESS_HELM_CHART_PUBLIC_AR_REPO := oci://$(LOCATION)-docker.pkg.dev/$(TEST_INFRA_PROJECT)/config-sync-test-public

# This target is run as a singleton against the ci-artifacts project, since
# these require for the registries to be public.
.PHONY: push-test-helm-charts-public
push-test-helm-charts-public: "$(HELM)"
helm pull $(WORDPRESS_HELM_CHART_PUBLIC_AR_REPO)/wordpress \
--version $(WORDPRESS_HELM_CHART_VERSION) &> /dev/null || \
$(MAKE) __push-test-helm-chart-from-pull

.PHONY: __push-test-helm-chart-from-pull
__push-test-helm-chart-from-pull: "$(HELM)"
helm pull $(WORDPRESS_HELM_CHART_SOURCE_REPO) --version $(WORDPRESS_HELM_CHART_VERSION)
@gcloud auth print-access-token | helm registry login -u oauth2accesstoken --password-stdin https://$(LOCATION)-docker.pkg.dev
helm push wordpress-$(WORDPRESS_HELM_CHART_VERSION).tgz $(WORDPRESS_HELM_CHART_PUBLIC_AR_REPO)

# The following targets are used to provision test resources in a prow environment

# kustomize-components private images (per dev/prow env registry)
Expand Down
2 changes: 1 addition & 1 deletion e2e/testcases/helm_sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,7 @@ func rootSyncForWordpressHelmChart(nt *nomostest.NT, valuesMutator func(map[stri
rs.Spec.Helm = &v1beta1.HelmRootSync{
Namespace: "wordpress",
HelmBase: v1beta1.HelmBase{
Repo: "https://charts.bitnami.com/bitnami",
Repo: "oci://us-docker.pkg.dev/kpt-config-sync-ci-artifacts/config-sync-test-public",
Chart: chartID.Name,
Version: chartID.Version,
ReleaseName: "my-wordpress",
Expand Down
7 changes: 5 additions & 2 deletions e2e/testdata/hydration/deprecated-GK/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,8 @@ helmCharts:
version: 0.2.0
releaseName: my-prometheus-operator

commonLabels:
test-case: hydration
labels:
- pairs:
test-case: hydration
includeSelectors: true
includeTemplates: true
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,8 @@ helmCharts:
commonAnnotations:
hydration-tool: kustomize

commonLabels:
team: monitoring
labels:
- pairs:
team: monitoring
includeSelectors: true
includeTemplates: true
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,16 @@ helmCharts:
namespace: coredns
valuesFile: https://raw.githubusercontent.com/config-sync-examples/helm-components/main/coredns-values.yaml
- name: wordpress
repo: https://charts.bitnami.com/bitnami
repo: oci://us-docker.pkg.dev/kpt-config-sync-ci-artifacts/config-sync-test-public
version: 15.2.35
releaseName: my-wordpress
namespace: wordpress
valuesInline:
service:
type: ClusterIP

commonLabels:
test-case: hydration
labels:
- pairs:
test-case: hydration
includeSelectors: true
includeTemplates: true
9 changes: 6 additions & 3 deletions e2e/testdata/hydration/helm-components/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ helmCharts:
releaseName: my-coredns
namespace: coredns
- name: wordpress
repo: https://charts.bitnami.com/bitnami
repo: oci://us-docker.pkg.dev/kpt-config-sync-ci-artifacts/config-sync-test-public
version: 15.2.35
releaseName: my-wordpress
namespace: wordpress
Expand All @@ -30,5 +30,8 @@ helmCharts:
service:
type: ClusterIP

commonLabels:
test-case: hydration
labels:
- pairs:
test-case: hydration
includeSelectors: true
includeTemplates: true
7 changes: 5 additions & 2 deletions e2e/testdata/hydration/helm-overlay/base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,8 @@ helmCharts:
commonAnnotations:
hydration-tool: kustomize

commonLabels:
team: coredns
labels:
- pairs:
team: coredns
includeSelectors: true
includeTemplates: true
7 changes: 5 additions & 2 deletions e2e/testdata/hydration/helm-overlay/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@
resources:
- overlay

commonLabels:
test-case: hydration
labels:
- pairs:
test-case: hydration
includeSelectors: true
includeTemplates: true
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,8 @@ resources:
- role.yaml
- networkpolicy.yaml

commonLabels:
test-case: hydration
labels:
- pairs:
test-case: hydration
includeSelectors: true
includeTemplates: true
7 changes: 5 additions & 2 deletions e2e/testdata/hydration/namespace-repo/base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@ resources:
- role.yaml
- networkpolicy.yaml

commonLabels:
test-case: hydration
labels:
- pairs:
test-case: hydration
includeSelectors: true
includeTemplates: true
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,8 @@ patches:
- op: replace
path: /subjects/0/name
value: [email protected]
commonLabels:
environment: dev
labels:
- pairs:
environment: dev
includeSelectors: true
includeTemplates: true
7 changes: 5 additions & 2 deletions e2e/testdata/hydration/remote-base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@
resources:
- overlay

commonLabels:
test-case: hydration
labels:
- pairs:
test-case: hydration
includeSelectors: true
includeTemplates: true
7 changes: 5 additions & 2 deletions e2e/testdata/hydration/remote-overlay-kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@
resources:
- github.com/config-sync-examples/kustomize-components/tenant-b?ref=main

commonLabels:
test-case: hydration
labels:
- pairs:
test-case: hydration
includeSelectors: true
includeTemplates: true
7 changes: 5 additions & 2 deletions e2e/testdata/hydration/remote-resources-kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@
resources:
- github.com/config-sync-examples/kustomize-components?ref=main

commonLabels:
test-case: hydration
labels:
- pairs:
test-case: hydration
includeSelectors: true
includeTemplates: true
7 changes: 5 additions & 2 deletions e2e/testdata/hydration/resource-duplicate/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,8 @@ resources:
- github.com/config-sync-examples/kustomize-components?ref=main
- namespace_tenant-a.yaml

commonLabels:
test-case: hydration
labels:
- pairs:
test-case: hydration
includeSelectors: true
includeTemplates: true

0 comments on commit 8dece8c

Please sign in to comment.