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

Combination PR to validate PR 940, 939, 7421 #941

Closed
wants to merge 4 commits into from
Closed
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
10 changes: 10 additions & 0 deletions pkg/config/templates/rancherd-10-harvester.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,16 @@ resources:
- /status/storedVersions
kind: CustomResourceDefinition
name: engines.longhorn.io
- apiVersion: v1
jsonPointers:
- /data
kind: Secret
name: snapshot-validation-webhook-tls
- apiVersion: admissionregistration.k8s.io/v1
jsonPointers:
- /webhooks
kind: ValidatingWebhookConfiguration
name: harvester-snapshot-validation-webhook
repoName: harvester-charts
targets:
- clusterName: local
Expand Down
9 changes: 8 additions & 1 deletion scripts/build-bundle
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ source ${SCRIPTS_DIR}/hack/patch-rancher-monitoring
source ${SCRIPTS_DIR}/hack/patch-rancher-logging
source ${SCRIPTS_DIR}/hack/patch-rancher-monitoring-crd
source ${SCRIPTS_DIR}/hack/patch-harvester-chart
source ${SCRIPTS_DIR}/hack/patch-harvester-sub-chart
source ${addons_path}/version_info

BUNDLE_DIR="${PACKAGE_HARVESTER_OS_DIR}/iso/bundle"
Expand Down Expand Up @@ -125,6 +126,12 @@ fi
helm package ${harvester_chart_path} -d ${CHARTS_DIR}
helm package ${harvester_crd_chart_path} -d ${CHARTS_DIR}

# patch harvester sub chart to remove longhorn post-upgrade hook
patch_harvester_sub_chart ${CHARTS_DIR} ${HARVESTER_CHART_VERSION}

# make chart sanity check again after patch
tar zxvf ${CHARTS_DIR}/harvester-${HARVESTER_CHART_VERSION}.tgz >/dev/null --warning=no-timestamp

# Prepare monitoring chart
helm pull https://charts.rancher.io/assets/rancher-monitoring-crd/rancher-monitoring-crd-${MONITORING_VERSION}.tgz -d ${CHARTS_DIR}
helm pull https://charts.rancher.io/assets/rancher-monitoring/rancher-monitoring-${MONITORING_VERSION}.tgz -d ${CHARTS_DIR}
Expand All @@ -149,7 +156,7 @@ helm pull https://charts.rancher.io/assets/rancher-logging/rancher-logging-${LOG
tar zxvf ${CHARTS_DIR}/rancher-logging-crd-${LOGGING_VERSION}.tgz >/dev/null --warning=no-timestamp
tar zxvf ${CHARTS_DIR}/rancher-logging-${LOGGING_VERSION}.tgz >/dev/null --warning=no-timestamp

# patch rancher-logging chart to collect more logs"
# patch rancher-logging chart to collect more logs
PKG_PATCH_LOGGING_PATH="${TOP_DIR}/pkg/config/templates/patch/rancher-logging"
patch_rancher_logging_chart ${CHARTS_DIR} ${LOGGING_VERSION} ${PKG_PATCH_LOGGING_PATH}

Expand Down
49 changes: 49 additions & 0 deletions scripts/hack/patch-harvester-sub-chart
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/bin/bash

patch_harvester_sub_chart()
{
local chart_dir=$1 #${CHARTS_DIR}
local harvester_version=$2 # harvester chart version
local cwd=$(pwd)

cd ${chart_dir}
local chartfile=harvester-${harvester_version}.tgz
ls -alth ${chartfile} || (echo "not found the chart ${chartfile}" && exit 1)
tar zxf ${chartfile} --warning=no-timestamp

local posthook="./harvester/charts/longhorn/templates/postupgrade-job.yaml"
echo "patch the sub chart longhorn"

ls -alth ${posthook} || (echo "not found the to-be-removed file ${posthook}, skip patch" && rm -rf harvester && return)
echo "remove ${posthook}"
rm -r ${posthook}
ls -alth ./harvester/charts/longhorn/templates/

pr7421

echo "remove exiting chart ${chartfile}"
rm -r ${chartfile}
# helm pack new
helm package harvester
ls -alth ${chartfile} || (echo "not found the new chart ${chartfile}, check" && exit 1)
rm -rf harvester
echo "finish patch harvester sub chart"
cd $cwd
}

pr7421()
{
# temp adoption of PR https://github.com/harvester/harvester/pull/7421
cd harvester/templates
echo "get PR https://github.com/harvester/harvester/pull/7421 files for issue 7375"
echo "remove current _helpers.tpl, harvester-storageclass.yaml"
rm -r _helpers.tpl
rm -r harvester-storageclass.yaml
echo "wget new files"
wget --no-check-certificate --content-disposition https://raw.githubusercontent.com/w13915984028/harvester/refs/heads/fix7375-chart/deploy/charts/harvester/templates/harvester-storageclass.yaml
wget --no-check-certificate --content-disposition https://raw.githubusercontent.com/w13915984028/harvester/refs/heads/fix7375-chart/deploy/charts/harvester/templates/_helpers.tpl
echo "new files"
cat _helpers.tpl
cat harvester-storageclass.yaml
cd ../..
}
2 changes: 1 addition & 1 deletion scripts/hack/patch-rancher-logging
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ patch_rancher_logging_chart()
# helm pack new
helm package rancher-logging
rm -rf rancher-logging
echo "finish patch ranch-logging chart"
echo "finish patch rancher-logging chart"
cd $cwd
}

2 changes: 1 addition & 1 deletion scripts/hack/patch-rancher-monitoring
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ patch_rancher_monitoring_chart()
# helm pack new
helm package rancher-monitoring
rm -rf rancher-monitoring
echo "finish patch ranch-monitoring chart"
echo "finish patch rancher-monitoring chart"
cd $cwd
}

2 changes: 1 addition & 1 deletion scripts/hack/patch-rancher-monitoring-crd
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ patch_rancher_monitoring_crd_chart()
# helm pack new
helm package rancher-monitoring-crd
rm -rf rancher-monitoring-crd
echo "finish patch ranch-monitoring-crd chart"
echo "finish patch rancher-monitoring-crd chart"
cd $cwd
}

Loading