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

images/kubecross: create a REGISTRY substitution to allow registry selection #1943

Merged
merged 1 commit into from
Mar 11, 2021

Conversation

cpanato
Copy link
Member

@cpanato cpanato commented Mar 11, 2021

What type of PR is this?

/kind feature

What this PR does / why we need it:

When building the image in another GCP project we need to push the image to the current project and not to the default one that is set in the makefile

this adds an env var to the GCB to set the REGISTRY env variable to be gcr.io/$PROJECT_ID

A previous fix was made but was a mistake because the env var stays in the POD level and not goes to the GCB (xref: kubernetes/test-infra#21307)

/assign @justaugustus

Which issue(s) this PR fixes:

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-priority size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Mar 11, 2021
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 11, 2021
@justaugustus
Copy link
Member

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 11, 2021
Copy link
Member

@justaugustus justaugustus left a comment

Choose a reason for hiding this comment

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

@cpanato -- You'll need to add this to the substitutions block, as well as variants.yaml, so we respect a user's REGISTRY choice if they decide to push the images to a project that is not the one they built the image in.

images/build/cross/cloudbuild.yaml Outdated Show resolved Hide resolved
@cpanato
Copy link
Member Author

cpanato commented Mar 11, 2021

now we have a REGISTRY substitution and the default value is the same as we have in the makefile which points to gcr.io/k8s-staging-build-image

The presubmit job will use the --env-passthrough to set a specific registry.

For other users using this they will need to set this in the variant or when calling the GCB perform the substitution flag

@cpanato cpanato requested a review from justaugustus March 11, 2021 13:51
@cpanato cpanato changed the title images/kubecross: set REGISTRY variable to be gcr.io/$PROJECTID images/kubecross: create a REGISTRY substitution to allow registry selection Mar 11, 2021
Copy link
Member

@justaugustus justaugustus left a comment

Choose a reason for hiding this comment

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

@cpanato -- Note the other substitutions in cloudbuild.yaml.

They're purposely set to "bad" values, so a run will fail if substitutions don't happen properly.
Let's do the same for REGISTRY.

images/build/cross/cloudbuild.yaml Outdated Show resolved Hide resolved
@k8s-ci-robot
Copy link
Contributor

@cpanato: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
pull-release-image-kube-cross d33cbbe link /test pull-release-image-kube-cross

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions 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/test-infra repository. I understand the commands that are listed here.

@justaugustus
Copy link
Member

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 11, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cpanato, justaugustus

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

@justaugustus
Copy link
Member

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 11, 2021
@k8s-ci-robot k8s-ci-robot merged commit d3888b0 into kubernetes:master Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority release-note-none Denotes a PR that doesn't merit a release note. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants