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

leverage generateTemplates capability of harvester/addons #783

Merged
merged 1 commit into from
Jul 30, 2024
Merged
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
5 changes: 4 additions & 1 deletion scripts/build
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ if [ "$(uname)" = "Linux" ]; then
fi

# render template files
cp ${addons_path}/pkg/templates/*.yaml ./pkg/config/templates
cd ${addons_path}
go run . -generateTemplates -path ${TOP_DIR}/pkg/config/templates

cd ${TOP_DIR}

CGO_ENABLED=0 go build -gcflags "${OTHER_COMPILERFLAGS}" -ldflags "$LINKFLAGS $OTHER_LINKFLAGS" -o bin/harvester-installer .

Expand Down
9 changes: 7 additions & 2 deletions scripts/build-bundle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ if [ ! -d ${addons_path} ];then
git clone --branch main --single-branch --depth 1 https://github.com/harvester/addons.git ../addons
fi

# will generate template file in ${addons_path}, and this is used for subsequent checks
cd ${addons_path}
go run . -generateTemplates
cd ${TOP_DIR}

source ${SCRIPTS_DIR}/version
source ${SCRIPTS_DIR}/version-rke2
source ${SCRIPTS_DIR}/version-rancher
Expand Down Expand Up @@ -140,9 +145,9 @@ check_addon_chart_version_matching() {
ls -alht ${CHARTS_DIR}

echo "addon template files"
ls -alht ${addons_path}/pkg/templates
ls -alht ${addons_path}
ibrokethecloud marked this conversation as resolved.
Show resolved Hide resolved

for filename in ${addons_path}/pkg/templates/*.yaml; do
for filename in ${addons_path}/*.yaml; do
local tmpfile=/tmp/$(basename ${filename})
grep -v "{{" ${filename} > ${tmpfile}
local cnt=$(yq '.resources | length' ${tmpfile})
Expand Down
Loading