Skip to content

Fix kind image names with --bare#1027

Merged
imjasonh merged 1 commit intoko-build:mainfrom
aidy:fix_kind_image_names
Mar 20, 2024
Merged

Fix kind image names with --bare#1027
imjasonh merged 1 commit intoko-build:mainfrom
aidy:fix_kind_image_names

Conversation

@aidy
Copy link
Contributor

@aidy aidy commented Apr 27, 2023

Make the functionality match between:
KO_DOCKER_REPO=ko.local/my-image ko build --bare

And:
KO_DOCKER_REPO=kind.local/my-image ko build --bare

As it stands, --bare is broken with kind.local/ as it just gets kind.local as the image name, and then it fails to tag because the registry is missing.

Make the functionality match between:
KO_DOCKER_REPO=ko.local/my-image ko build --bare

And:
KO_DOCKER_REPO=kind.local/my-image ko build --bare

As it stands, `--bare` is broken with `kind.local/` as it just gets
`kind.local` as the image name, and then it fails to tag because the
registry is missing.
@github-actions
Copy link

This Pull Request is stale because it has been open for 90 days with
no activity. It will automatically close after 30 more days of
inactivity. Keep fresh with the 'lifecycle/frozen' label.

@nitinmohan87
Copy link

@imjasonh Any chances this PR can be reviewed/merged?

@cpanato cpanato reopened this Mar 4, 2024
@cpanato cpanato requested a review from imjasonh March 4, 2024 19:30
Copy link
Member

@cpanato cpanato left a comment

Choose a reason for hiding this comment

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

is it possible to add some tests?

@aidy
Copy link
Contributor Author

aidy commented Mar 4, 2024

@cpanato It's been nearly a year since I raised this, but I'll try to remember how it hangs together.

@aidy
Copy link
Contributor Author

aidy commented Mar 5, 2024

I don't think it's possible to write a useful test for this without either instantiating a new kind cluster (making tests much more heavyweight), or by doing some fairly hefty refactoring to expose some of the kind publisher internals to allow mock kinds to be injected from other packages.

@aidy
Copy link
Contributor Author

aidy commented Mar 5, 2024

or by doing some fairly hefty refactoring to expose some of the kind publisher internals to allow mock kinds to be injected from other packages.

Would look something like: aidy/ko@fix_kind_image_names...aidy:ko:fix_kind_image_names_test

Can add to this PR if you'd like, but obviously it does open up some internals.

@nitinmohan87
Copy link

Thanks for reopening the PR and getting it ready @aidy and @cpanato ! Any thoughts on getting this merged?

@imjasonh imjasonh enabled auto-merge (rebase) March 20, 2024 17:44
@imjasonh imjasonh merged commit 5ce94b9 into ko-build:main Mar 20, 2024
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.

4 participants