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

feat(oci): add login to generic repositories #128

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
7 changes: 7 additions & 0 deletions assets/out
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ fi

helm_registry_login() {
ecr=$(jq -r '.params.private_registry|has("ecr")' < $payload)
generic=$(jq -r '.params.private_registry|has("generic")' < $payload)
if [ "${ecr}" = true ]; then
region=$(jq -r '.params.private_registry.ecr.region // ""' < $payload)
account_id=$(jq -r '.params.private_registry.ecr.account_id // ""' < $payload)
Expand Down Expand Up @@ -153,6 +154,12 @@ helm_registry_login() {
aws ecr get-login-password --region ${region} ${profile_opt} | helm registry login --username AWS --password-stdin ${account_id}.dkr.ecr.${region}.amazonaws.com
fi
echo "done logging in to ECR"
elif [ "${generic}" = true ]; then
registry_host=$(jq -r '.params.private_registry.generic.host // ""' < $payload)
registry_username=$(jq -r '.params.private_registry.generic.username // ""' < $payload)
registry_password=$(jq -r '.params.private_registry.generic.password // ""' < $payload)
echo "$registry_password" | helm registry login $registry_host --username $registry_username --password-stdin
echo "done logging in to generic registry"
else
# implement support for other helm registry following a similar pattern
echo "unsupported private reigistry configuration"
Expand Down