Skip to content

Commit

Permalink
Vendor in the bitnami chart (apache#24395)
Browse files Browse the repository at this point in the history
After the Bitnami fiasco
bitnami/charts#10539

We lost trust in bitnami index being good and reliable source
of charts. That's why we vendored-in the postgres chart needed for
our Helm chart.

Fixes: apache#24037
  • Loading branch information
potiuk authored Jun 14, 2022
1 parent 5d5976c commit 779571b
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 54 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,6 @@ log.txt*
# Terraform variables
*.tfvars

# Chart dependencies
**/charts/*.tgz

# Might be generated when you build wheels
pip-wheel-metadata

Expand Down
3 changes: 0 additions & 3 deletions chart/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,5 @@ config.yml
# Build dir
repository

# Chart dependencies
**/charts/*.tgz

# Never check in tmpcharts
tmpcharts
3 changes: 1 addition & 2 deletions chart/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
dependencies:
- name: postgresql
repository: https://raw.githubusercontent.com/bitnami/charts/eb5f9a9513d987b519f0ecd732e7031241c50328/bitnami
version: 10.5.3
digest: sha256:7104938113e866364a96f78802697be6bd121526cccbd06cae6a38827b7b36f9
generated: "2022-06-02T16:31:53.771359036+02:00"
generated: "2022-06-11T22:19:11.389661+02:00"
7 changes: 0 additions & 7 deletions chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,6 @@ keywords:
dependencies:
- name: postgresql
version: 10.5.3
# In order to react to a sudden, totally breaking change by bitnami in
# https://github.com/bitnami/charts/issues/10539
# we need to use the version of index from just before the change. However we hope
# it is only temporary change as it breaks all our charts we released so far
# see comment here https://github.com/bitnami/charts/issues/10539#issuecomment-1144869092
repository: >-
https://raw.githubusercontent.com/bitnami/charts/eb5f9a9513d987b519f0ecd732e7031241c50328/bitnami
condition: postgresql.enabled
maintainers:
- email: [email protected]
Expand Down
3 changes: 0 additions & 3 deletions chart/INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
# The Assumption here is that you have a running Kubernetes cluster
# and helm installed & configured to talk with the cluster

# Run `helm dependency update` Command to install dependencies (postgresql)
helm dependency update

# Run `helm install` Command
helm install airflow .

Expand Down
11 changes: 11 additions & 0 deletions chart/NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,14 @@ Copyright 2016-2021 The Apache Software Foundation
This product includes software developed at The Apache Software
Foundation (http://www.apache.org/).
=======================================================================

postgresql:
-----
This product contains vendored-in postgresql Helm chart.

Copyright © 2022 Bitnami

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

http://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.
Binary file added chart/charts/postgresql-10.5.3.tgz
Binary file not shown.
4 changes: 1 addition & 3 deletions scripts/ci/libraries/_kind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function kind::make_sure_kubernetes_tools_are_installed() {
kubectl_url="https://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VERSION}/bin/${system}/${machine}/kubectl"
if [[ -f "${KUBECTL_BINARY_PATH}" ]]; then
local downloaded_kubectl_version
downloaded_kubectl_version="$(${KUBECTL_BINARY_PATH} version --client=true --short | awk '{ print $3 }')"
downloaded_kubectl_version="$(${KUBECTL_BINARY_PATH} version --client=true | awk '{ print $3 }')"
echo "Currently downloaded kubectl version = ${downloaded_kubectl_version}"
fi
if [[ ! -f "${KUBECTL_BINARY_PATH}" || ${downloaded_kubectl_version} != "${KUBECTL_VERSION}" ]]; then
Expand Down Expand Up @@ -349,7 +349,6 @@ function kind::deploy_airflow_with_helm() {

pushd "${chartdir}/chart" >/dev/null 2>&1 || exit 1
helm repo add stable https://charts.helm.sh/stable/
helm dep update
helm install airflow . \
--timeout 10m0s \
--namespace "${HELM_AIRFLOW_NAMESPACE}" \
Expand Down Expand Up @@ -384,7 +383,6 @@ function kind::upgrade_airflow_with_helm() {

pushd "${chartdir}/chart" >/dev/null 2>&1 || exit 1
helm repo add stable https://charts.helm.sh/stable/
helm dep update
helm upgrade airflow . --namespace "${HELM_AIRFLOW_NAMESPACE}" \
--set "defaultAirflowRepository=${AIRFLOW_IMAGE_KUBERNETES}" \
--set "images.airflow.repository=${AIRFLOW_IMAGE_KUBERNETES}" \
Expand Down
33 changes: 0 additions & 33 deletions tests/charts/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,43 +15,10 @@
# specific language governing permissions and limitations
# under the License.

import subprocess
from pathlib import Path

import pytest
from filelock import FileLock

chart_dir = (Path(__file__).parent / ".." / ".." / "chart").resolve()


@pytest.fixture(autouse=True, scope="session")
def initialize_airflow_tests(request):
# Skip airflow tests initialization for all Helm tests
return


@pytest.fixture(autouse=True, scope="session")
def upgrade_helm(tmp_path_factory, worker_id):
"""
Upgrade Helm repo
"""

def _upgrade_helm():
subprocess.check_output(
["helm", "repo", "add", "stable", "https://charts.helm.sh/stable/"], cwd=chart_dir
)
subprocess.check_output(["helm", "dep", "update", chart_dir], cwd=chart_dir)

if worker_id == "main":
# not executing in with multiple workers, just update
_upgrade_helm()
return

root_tmp_dir = tmp_path_factory.getbasetemp().parent
lock_fn = root_tmp_dir / "upgrade_helm.lock"
flag_fn = root_tmp_dir / "upgrade_helm.done"

with FileLock(str(lock_fn)):
if not flag_fn.is_file():
_upgrade_helm()
flag_fn.touch()

0 comments on commit 779571b

Please sign in to comment.