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

Add support for --local for ko #949

Merged
merged 1 commit into from
Aug 4, 2022

Conversation

yuzp1996
Copy link
Contributor

@yuzp1996 yuzp1996 commented Jul 31, 2022

When try to run operator with code you must set ENV KO_DOCKER_REPO
while it is not convenient for developer.

Now adding a flags that will be used by ko when you run make apply.
So you can add any flags you want to ko now.

Issue: #950

Signed-off-by: yuzhipeng yuzp1996@qq.com

Changes

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

See the contribution guide for more details.

Release Notes

@tekton-robot tekton-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Jul 31, 2022
@tekton-robot tekton-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jul 31, 2022
@tekton-robot
Copy link
Contributor

Hi @yuzp1996. Thanks for your PR.

I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@tekton-robot tekton-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jul 31, 2022
@yuzp1996 yuzp1996 changed the title Add support for --local for KO Add support for --local for ko Aug 1, 2022
DEVELOPMENT.md Outdated
@@ -230,7 +230,8 @@ If the files in `pkg/apis` are updated we need to run `codegen` scripts
```

### Setup
- Set `KO_DOCKER_ENV` environment variable ([ko#usage](https://github.com/google/ko#usage))
- Set `KO_DOCKER_REPO` environment variable ([ko#usage](https://github.com/google/ko#usage))
- If you want to use local image rather than pushing image to registry you can set flags with `KO_FALGS=--local` when you run operator
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- If you want to use local image rather than pushing image to registry you can set flags with `KO_FALGS=--local` when you run operator
- If you want to use local image rather than pushing image to registry you can set flags with `KO_FLAGS=--local` when you run operator

Makefile Outdated
@@ -97,7 +97,7 @@ get-releases: |
apply: | $(KO) $(KUSTOMIZE) get-releases ; $(info $(M) ko apply on $(TARGET)) @ ## Apply config to the current cluster
@ ## --load-restrictor LoadRestrictionsNone is needed in kustomize build as files which not in child tree of kustomize base are pulled
@ ## https://github.com/kubernetes-sigs/kustomize/issues/766
$Q $(KUSTOMIZE) build --load-restrictor LoadRestrictionsNone config/$(TARGET)/overlays/default | $(KO) apply $(PLATFORM) -f -
$Q $(KUSTOMIZE) build --load-restrictor LoadRestrictionsNone config/$(TARGET)/overlays/default | $(KO) apply $(KO_FALGS) $(PLATFORM) -f -
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
$Q $(KUSTOMIZE) build --load-restrictor LoadRestrictionsNone config/$(TARGET)/overlays/default | $(KO) apply $(KO_FALGS) $(PLATFORM) -f -
$Q $(KUSTOMIZE) build --load-restrictor LoadRestrictionsNone config/$(TARGET)/overlays/default | $(KO) apply $(KO_FLAGS) $(PLATFORM) -f -

@sm43
Copy link
Member

sm43 commented Aug 3, 2022

Thank you for the PR. 😃
Just a minor nit comment.

@sm43 sm43 closed this Aug 3, 2022
@sm43 sm43 reopened this Aug 3, 2022
When try to run operator with code you must set ENV KO_DOCKER_REPO
while it is not convenient for developer.

Now adding a flags that will be used by KO when you run `make apply`.
So you can add any flags you want to KO now.

Signed-off-by: yuzhipeng <yuzp1996@qq.com>
@yuzp1996
Copy link
Contributor Author

yuzp1996 commented Aug 3, 2022

Thank you for the PR. 😃 Just a minor nit comment.

Thanks for your review! I have changed FALGS to FLAGS. Nice catch!

@sm43 sm43 added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Aug 4, 2022
@tekton-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by:

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

@piyush-garg
Copy link
Contributor

/lgtm
/ok-to-test

@tekton-robot tekton-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Aug 4, 2022
@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 4, 2022
@tekton-robot tekton-robot merged commit 9346523 into tektoncd:main Aug 4, 2022
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. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. 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.

None yet

4 participants