Skip to content

Conversation

@allxiao
Copy link
Contributor

@allxiao allxiao commented Nov 1, 2017

No description provided.

@allxiao allxiao requested review from chenkennt and zackliu November 1, 2017 08:13
@allxiao allxiao force-pushed the it branch 6 times, most recently from 28053b7 to 09fb03b Compare November 3, 2017 06:24
export KUBERNETES_CD_DOCKER_PASSWORD="$(az acr credential show --name "$acr_name" --query "passwords[0].value" --output tsv)"
export KUBERNETES_CD_DOCKER_REGISTRY="http://$KUBERNETES_CD_DOCKER_REPOSITORY"

docker pull nginx
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be called even if KUBERNETES_CD_DOCKER_REPOSITORY is empty?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The intention here is:

  • if we test against existing docker repository, we pass in all the details of the repo and then we skip the repository setup
  • otherwise if KUBERNETES_CD_DOCKER_REPOSITORY is empty, we setup new ACR instance and prepare the image for testing

bash src/test/java/com/microsoft/jenkins/kubernetes/integration/integration-test.sh

Prerequisites:
* Logged in Azure CLI
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this plugin is a general k8s plugin, provide an option that user can run the test without Azure (suppose they have already have a k8s cluster)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the user pass in all the details, we will skip the Azure ACS & ACR setup. We have a check to ensure that

resource_group=
if [[ -z "$KUBERNETES_CD_MASTER_HOST" ]] || [[ -z "$KUBERNETES_CD_DOCKER_REPOSITORY" ]]; then
    resource_group="k8s-test-$suffix"
fi

However, currently the check for az account happens too early. It is not necessary if user do not need to provision Azure resources. I will update the code logic and the documentation.

import java.io.OutputStream;
import java.util.UUID;

public class TestHelpers {
Copy link
Contributor

Choose a reason for hiding this comment

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

Move some common methods to common plugin so that they can be reused?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

make sense. I will copy the logic to commons and when that's available in new commons release, we can remove the duplicates in the descendants.

@gavinfish
Copy link
Member

Why not merge this PR? @ArieShout

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.

3 participants