Building and pushing to kind when offline
- Dominant language
- Go
- Stars
- 8.5k
- Forks
- 447
- PR merge metrics
- No merged PRs in 30d
Description
Today I had a network outage and I've found out that ko doesn't work when offline when trying to push to kind, even if the base image is already on the machine:
```
2021/01/15 11:17:43 Using base docker.io/debian for knative.dev/control-data-plane-communication/cmd/webhook
2021/01/15 11:17:43 Using base docker.io/debian for knative.dev/control-data-plane-communication/cmd/receive_adapter
2021/01/15 11:17:43 Using base docker.io/debian for knative.dev/control-data-plane-communication/cmd/controller
namespace/knative-samples unchanged
serviceaccount/control-data-plane-communication-controller unchanged
serviceaccount/control-data-plane-communication-webhook unchanged
clusterrole.rbac.authorization.k8s.io/control-data-plane-communication-controller unchanged
clusterrole.rbac.authorization.k8s.io/control-data-plane-communication-observer unchanged
clusterrolebinding.rbac.authorization.k8s.io/control-data-plane-communication-controller-rolebinding unchanged
clusterrolebinding.rbac.authorization.k8s.io/control-data-plane-communication-webhook-rolebinding unchanged
clusterrolebinding.rbac.authorization.k8s.io/control-data-plane-communication-controller-addressable-resolver unchanged
clusterrole.rbac.authorization.k8s.io/control-data-plane-communication-webhook unchanged
customresourcedefinition.apiextensions.k8s.io/samplesources.samples.knative.dev unchanged
service/control-data-plane-communication-controller-manager unchanged
mutatingwebhookconfiguration.admissionregistration.k8s.io/defaulting.webhook.knative-samples.knative.dev unchanged
validatingwebhookconfiguration.admissionregistration.k8s.io/validation.webhook.knative-samples.knative.dev unchanged
validatingwebhookconfiguration.admissionregistration.k8s.io/config.webhook.knative-samples.knative.dev unchanged
secret/webhook-certs unchanged
configmap/config-logging unchanged
configmap/config-observability unchanged
2021/01/15 11:17:43 error processing import paths in "config/500-webhook.yaml": error resolving image references: Get "https://index.docker.io/v2/": dial tcp: lookup index.docker.io: no such host
```
After a discussion with @ImJasonH, We've found out that ko needs to check on docker hub if I have on my machine the last debian image. I wonder, can we just print the warning without failing and trying to perform a "best effort" build in that case?
Contributor guide
Research direction
Reproduce the offline failure while deploying the configuration in config/500-webhook.yaml, then trace the image-reference resolution that requests index.docker.io. Compare behavior with the debian base image already local. Done means pushing to kind works offline with a warning and best-effort build instead of failing solely because Docker Hub cannot be reached.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, go, kubernetes
- Domain
- devops, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100