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

Pass proxyRegistry credentials to buildImages #223

Merged
merged 3 commits into from
Sep 6, 2024

Conversation

nihussmann
Copy link
Contributor

this feature allows users to set credentials for the registry when the twoRegistries option is enabled.

@schnatterer schnatterer changed the title adding registry credentials for twoRegistries option Pass proxyRegistry credentials to buildImages Sep 4, 2024
@schnatterer
Copy link
Member

I rebased to main, fixing the conflicts imposed by #221

Copy link
Member

@schnatterer schnatterer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost done with your first PR 👏
Please resolve my two findings and then squash all commits into one or two.
My suggestion would be to keep the refactoring commit and squash all further commits (including mine) into one that says something like Add credentials to build images.
You can add the comment about TLS in the extended message, i.e. line 3 or later.

nihussmann and others added 2 commits September 6, 2024 11:47
adding security by default for local GOP
Adapt test to find syntactic error in helm/Jenkinsfile.ftl

Error in plain Jenkinsfile.ftl has been sitting there unnoticed for
years 😬
Copy link
Member

@schnatterer schnatterer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nihussmann Great work!
To not overburden you with complexity in your first ticket, I didn't tell you how to try this new feature in GOP. I tested it and came up with two minor fixes in 9586531.
So I adapted the test to fail and then fixed it 🙂

For testing, I set up harbor as "external" registry, following our manual.

I then pushed the buildImages into harbor:

skopeo copy docker://ghcr.io/cloudogu/gitops-playground --dest-creds Proxy:Proxy12345 --dest-tls-verify=false  docker://localhost:30000/proxy/kubectl
skopeo copy docker://ghcr.io/cloudogu/helm:3.15.4-1 --dest-creds Proxy:Proxy12345 --dest-tls-verify=false  docker://localhost:30000/proxy/helm
 skopeo copy docker://cytopia/yamllint:1.25-0.7 --dest-creds Proxy:Proxy12345 --dest-tls-verify=false  docker://localhost:30000/proxy/yamllint

and finally set up GOP to use the build images:

docker run --rm -t -u $(id -u)  \
   -v ~/.config/k3d/kubeconfig-gitops-playground.yaml:/home/.kube/config  \
    --net=host  \
    gitops-playground:dev \
    --yes --argocd --ingress-nginx --base-url=http://localhost \
    --registry-url=localhost:30000 \
    --registry-path=registry \
    --registry-username=Registry  \
    --registry-password=Registry12345 \
    --registry-proxy-url=localhost:30000 \
    --registry-proxy-username=Proxy \
    --registry-proxy-password=Proxy12345 \
    --petclinic-image=localhost:30000/proxy/eclipse-temurin:11-jre-alpine \
    --kubectl-image=localhost:30000/proxy/kubectl \
    --helm-image=localhost:30000/proxy/helm \
    --yamllint-image=localhost:30000/proxy/yamllint

With this, I can see the two petclinic builds succeed and Jenkins logs tell me that localhost:30000/proxy/ images were used 🥳

@schnatterer schnatterer merged commit 899a98d into main Sep 6, 2024
1 check passed
@schnatterer schnatterer deleted the feature/buildimage-credentials branch September 6, 2024 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants