ko-build / ko-build/ko

Check for push permissions before building

Open
#539 7 comments 2 reactions 0 assignees View on GitHub
good first issue lifecycle/frozen
Dominant language
Go
Stars
8.5k
Forks
447
PR merge metrics
No merged PRs in 30d

Description

If I'm `ko publish`ing to a registry/repository that I don't have push permissions to (typo, misconfigured auth, incorrect active `gcloud` user), `ko` can check that and fail before building, using ggcr's [`CheckPushPermission`](https://pkg.go.dev/github.com/google/go-containerregistry/pkg/v1/remote#CheckPushPermission).

That has a `TODO`(https://github.com/google/go-containerregistry/issues/412) to make it unnecessary, but I think this is actually a case where it's useful, since it can avoid work and save time before `remote.Write`ing.

Contributor guide

Open the contributing guide

Research direction

Start with the `ko publish` flow and the go-containerregistry `CheckPushPermission` entry point. Trace how the destination registry is selected and where `remote.Write` follows the build; done means an unauthorized destination fails before the image is built, while authorized publishing continues normally.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
devops
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.