Skip to content

Commit

Permalink
Resolving comments
Browse files Browse the repository at this point in the history
  • Loading branch information
gannaraputeja committed Aug 21, 2024
1 parent a135980 commit 6886833
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions docs/guides/general/private-registry.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ trap "exit" INT

region="us-west-2"
registry="your.registry"
repositoryPrefix="${repositoryPrefix:-levoai}" # Optional, replace with your repository prefix in case you are using a different repository
repositoryPrefix="${repositoryPrefix:-}" # Optional, replace with your repository prefix, in case you are using a different repository

helm repo add levoai https://charts.levo.ai || true
helm repo update
Expand All @@ -33,8 +33,13 @@ images+=($(helm template levoai/levoai-ebpf-sensor | yq -N '..|.image? | select(

for image in "${images[@]}"; do
src_image=${image#"docker.io/"}
repo_name=${src_image#*/}
dest_image="$registry/$repositoryPrefix/$repo_name"
if [ -n "$repositoryPrefix" ]; then
repo_name=${src_image#*/}
dest_image="$registry/$repositoryPrefix/$repo_name"
else
repo_name=${src_image%:*}
dest_image="$registry/$src_image"
fi
aws ecr describe-repositories --repository-names $repo_name --region $region || aws ecr create-repository --repository-name $repo_name --region $region
echo "Copying $src_image to $dest_image"
docker buildx imagetools create --tag $dest_image $src_image
Expand Down

0 comments on commit 6886833

Please sign in to comment.