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

Fix all Azure CLI commands used in Tanzu deployer #5585

Merged
merged 1 commit into from
Apr 19, 2022

Conversation

pebrc
Copy link
Collaborator

@pebrc pebrc commented Apr 17, 2022

This makes the necessary changes to use use the Docker based CLI also from the Tanzu deployer which was missed in the
original change that introduced the Docker based Azure CLI tooling.

This makes the necessary changes to use use the Docker based CLI also from the Tanzu deployer which was missed in the
original change that introduced the Docker based Azure CLI tooling.
@pebrc pebrc added :ci Things related to Continuous Integration, automation and releases >test Related to unit/integration/e2e tests labels Apr 17, 2022
"ContainerRegistry": t.acrName,
}).Run()
// the Azure CLI image we use does not have a Docker client installed thus we extract a token here ...
jsonResp, err := azure.Cmd("acr", "login", "--name", t.acrName, "--expose-token").
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I wonder if it is possible to avoid --expose-token. I would expect $HOME/.docker/config.json to be updated by az acr login --name REDACTED as it would be by docker login -u .... -p token?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It does indeed update the docker config but the issue is that inside the Azure CLI container we don't have the Docker tooling so this update fails. We could now of course build our own image for the Azure tools that includes Dockers CLI. Or we could integrate the Azure tools into the Tanzu image we already maintain.

I decided to use the method proposed in this PR because it avoids the additional maintenance burden of another Docker image and the (perceived) security disadvantage seemed acceptable.

Copy link
Contributor

Choose a reason for hiding this comment

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

Makes sense, I was wrongly assuming that az could update the credentials without docker.
LGTM overall, I'm giving it a try in Jenkins 🤞

Copy link
Contributor

@barkbay barkbay left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@pebrc pebrc merged commit bb9a51f into elastic:main Apr 19, 2022
@thbkrkr thbkrkr added the v2.3.0 label Apr 21, 2022
fantapsody pushed a commit to fantapsody/cloud-on-k8s that referenced this pull request Feb 7, 2023
This makes the necessary changes to use use the Docker based CLI also from the Tanzu deployer which was missed in the
original change that introduced the Docker based Azure CLI tooling.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:ci Things related to Continuous Integration, automation and releases >test Related to unit/integration/e2e tests v2.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants