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

Make ACR as the default registry for Azure #2335

Merged
merged 21 commits into from Nov 30, 2018

Conversation

Projects
None yet
5 participants
@yuwzho
Copy link
Contributor

yuwzho commented Nov 27, 2018

Submitter checklist

  • Change is code complete and matches issue description.
  • Change is covered by existing or new tests.

Description

Make ACR as the default registry for Azure scenario.

  1. Use existing ACR specified by user or create a new one with the same name as AKS
  2. Retrieve and save the ACR's credential to jx namespace and set login server to Jenkins server
  3. Grant AKS a reader role for ACR, make ACR is a public registry for AKS.

Special notes for the reviewer(s)

Which issue this PR fixes

fixes #1805

@jenkins-x-bot jenkins-x-bot requested review from markawm and mikecirioli Nov 27, 2018

Show resolved Hide resolved pkg/jx/cmd/install.go Outdated
Show resolved Hide resolved pkg/cloud/aks/aks.go Outdated
Show resolved Hide resolved pkg/cloud/aks/aks.go Outdated
Show resolved Hide resolved pkg/cloud/aks/aks.go Outdated
Show resolved Hide resolved pkg/cloud/aks/aks.go Outdated
Show resolved Hide resolved pkg/cloud/aks/aks.go Outdated
Show resolved Hide resolved pkg/cloud/aks/aks.go Outdated
Show resolved Hide resolved pkg/cloud/aks/aks.go Outdated
Show resolved Hide resolved pkg/cloud/aks/aks.go Outdated
Show resolved Hide resolved pkg/cloud/aks/aks.go Outdated
Show resolved Hide resolved pkg/cloud/aks/aks.go Outdated

yuwzho added some commits Nov 27, 2018

@ccojocar
Copy link
Member

ccojocar left a comment

Thanks for your contribution. It would be also nice if you can write some tests. If you switch to util.Command, there is a fake command execution which can be used in util/mocks/commander.go. You can see an example of its usage in helm_cli_test.go. Thanks

Show resolved Hide resolved pkg/cloud/aks/aks.go Outdated
Show resolved Hide resolved pkg/cloud/aks/aks.go Outdated
Show resolved Hide resolved pkg/cloud/aks/aks.go Outdated
Show resolved Hide resolved pkg/cloud/aks/aks.go Outdated
Show resolved Hide resolved pkg/cloud/aks/aks.go Outdated
@jstrachan

This comment has been minimized.

Copy link
Member

jstrachan commented Nov 27, 2018

/ok-to-test

@yuwzho yuwzho force-pushed the yuwzho:yuwzho-aks branch from 265664a to 570f7cb Nov 28, 2018

@ccojocar
Copy link
Member

ccojocar left a comment

Thank you for addressing the review comments. I would really appreciate if you could turn the global variable into a type with constructor. See my suggestion in the review. Thanks

Show resolved Hide resolved pkg/cloud/aks/aks.go Outdated
Show resolved Hide resolved pkg/cloud/aks/aks.go
Show resolved Hide resolved pkg/cloud/aks/aks.go
Show resolved Hide resolved pkg/cloud/aks/aks.go

yuwzho added some commits Nov 29, 2018

@jenkins-x-bot jenkins-x-bot added the lgtm label Nov 29, 2018

@jenkins-x-bot jenkins-x-bot removed the lgtm label Nov 29, 2018

@ccojocar

This comment has been minimized.

Copy link
Member

ccojocar commented Nov 29, 2018

/test bdd

@ccojocar

This comment has been minimized.

Copy link
Member

ccojocar commented Nov 29, 2018

@yuwzho One of the unit tests is failing:

--- FAIL: TestRegistry404 (0.00s)
    aks_test.go:77:
                Error Trace:    aks_test.go:77
                Error:          Not equal:
                                expected: "fakeidxxx"
                                actual  : "{\n\t\t\t\"passwords\": [\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"password\",\n\t\t\t\t\t\"value\": \"password123\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"password2\",\n\t\t\t\t\t\"value\": \"passwordabc\"\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"username\": \"azure\"\n\t\t}"

                                Diff:
                                --- Expected
                                +++ Actual
                                @@ -1 +1,13 @@
                                -fakeidxxx
                                +{
                                +                       "passwords": [
                                +                               {
                                +                                       "name": "password",
                                +                                       "value": "password123"
                                +                               },
                                +                               {
                                +                                       "name": "password2",
                                +                                       "value": "passwordabc"
                                +                               }
                                +                       ],
                                +                       "username": "azure"
                                +               }
                Test:           TestRegistry404
FAIL
@yuwzho

This comment has been minimized.

Copy link
Contributor

yuwzho commented Nov 29, 2018

@ccojocar Sorry for the test failure, I removed the quote from azure CLI response but forgot to modify the fake matcher

@ccojocar

This comment has been minimized.

Copy link
Member

ccojocar commented Nov 29, 2018

/test bdd

@ccojocar

This comment has been minimized.

Copy link
Member

ccojocar commented Nov 29, 2018

@yuwzho No problem! Thanks for fixing it.

@ccojocar

This comment has been minimized.

Copy link
Member

ccojocar commented Nov 29, 2018

/retest

@ccojocar

This comment has been minimized.

Copy link
Member

ccojocar commented Nov 29, 2018

/test bdd

@yuwzho

This comment has been minimized.

Copy link
Contributor

yuwzho commented Nov 30, 2018

lgtm label was removed, does it matter for auto merge? @ccojocar

@yuwzho

This comment has been minimized.

Copy link
Contributor

yuwzho commented Nov 30, 2018

Hi @ccojocar seems I need another lgtm label to make the PR merged

@ccojocar

This comment has been minimized.

Copy link
Member

ccojocar commented Nov 30, 2018

/lgtm

@jenkins-x-bot jenkins-x-bot added the lgtm label Nov 30, 2018

@ccojocar

This comment has been minimized.

Copy link
Member

ccojocar commented Nov 30, 2018

/retest

@yuwzho

This comment has been minimized.

Copy link
Contributor

yuwzho commented Nov 30, 2018

/test bdd

@yuwzho

This comment has been minimized.

Copy link
Contributor

yuwzho commented Nov 30, 2018

/retest

@yuwzho

This comment has been minimized.

Copy link
Contributor

yuwzho commented Nov 30, 2018

@ccojocar hi I can not see what's the failure, could you help me?

@ccojocar

This comment has been minimized.

Copy link
Member

ccojocar commented Nov 30, 2018

It's an issue related to our BDD tests infra. We are restoring it soon.

@ccojocar

This comment has been minimized.

Copy link
Member

ccojocar commented Nov 30, 2018

/test bdd

@jenkins-x-bot jenkins-x-bot removed the lgtm label Nov 30, 2018

@ccojocar

This comment has been minimized.

Copy link
Member

ccojocar commented Nov 30, 2018

/lgtm

@jenkins-x-bot jenkins-x-bot added the lgtm label Nov 30, 2018

@jenkins-x-bot

This comment has been minimized.

Copy link
Contributor

jenkins-x-bot commented Nov 30, 2018

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ccojocar

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@jenkins-x-bot jenkins-x-bot merged commit dc3086b into jenkins-x:master Nov 30, 2018

3 checks passed

Hound No violations found. Woof!
serverless-jenkins succeeded
tide In merge pool.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment