Conversation
func config ci told users to create vars.REGISTRY_URL when registry login was enabled, where the workflow does not use it, and left it out when registry login was disabled, where the workflow needs it for FUNC_REGISTRY. A workflow set up from the message then failed with "registry required". List exactly the secrets and variables the workflow uses, in both the post-export message and the verbose output, and add a test that checks the message against the generated workflow. Fixes knative#4229
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: anjalirj27 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @anjalirj27. Thanks for your PR. I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Changes
func config cinow lists exactly the GitHub Secrets and Variables the generated workflow uses. With registry login it no longer asks forvars.REGISTRY_URL, which the workflow doesn't use; without registry login it now asks forvars.REGISTRY_URL, which the workflow needs forFUNC_REGISTRY. Applies to the post-export message and the--verboseoutput.*Many*/*One*to*WithLogin*/*WithoutLogin*, since the no-login list now has two entries./kind bug
Fixes #4229
Why: a user who followed the message with
--registry-login=falsenever createdREGISTRY_URL, so the workflow ran with an emptyFUNC_REGISTRYand failed withregistry required. Reproduction is in #4229.Testing:
TestCIGenerator_MessageListsWorkflowSecretsAndVars: for registry login on/off and normal/verbose output, thesecrets.*/vars.*names in the message must equal those in the generated workflow. Run against the oldprinter.go, all four cases fail, showing the extravars.REGISTRY_URLwith login and the missing one without.go test ./pkg/ci/... ./cmd/ -run ConfigCIpasses.golangci-lint run ./pkg/ci/...reports 0 issues. A fullmake checkreports 9 pre-existing staticcheck findings in files this PR doesn't touch (cmd/deploy_test.go,cmd/logs_test.go,pkg/git/gitlab,pkg/lister/testing); they appear onmainas well.funcbuilt from this branch,func config ci --registry-login=truelistsKUBECONFIG,REGISTRY_PASSWORD,REGISTRY_LOGIN_URL,REGISTRY_USERNAME;--registry-login=falselistsKUBECONFIG,REGISTRY_URL, matchingFUNC_REGISTRYin each workflow.Release Note
Docs