From f12b9e62deae55e73f9b11a0ce3755465166d0db Mon Sep 17 00:00:00 2001 From: Jason Hall Date: Mon, 27 Jan 2020 12:21:50 -0500 Subject: [PATCH] Document strict mode in README.md (#126) --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 54d8d8d2a2..750d2984f1 100644 --- a/README.md +++ b/README.md @@ -265,6 +265,19 @@ of convenience for cleaning up resources created through `ko apply`. `ko version` prints version of ko. For not released binaries it will print hash of latest commit in current git tree. +### Strict Mode + +It can be difficult for `ko` to determine whether a string in a YAML file is +intended to be an import path, due to typos, non-`package main` packages, and +conflicts between import paths and common strings (e.g., a package whose +import path is `busybox`). To solve this, `ko` supports "Strict Mode". + +When referencing an import path in the YAML file, prefix the string with +the string `ko://` (e.g., `ko://github.com/my/repo/cmd/foo`). Then, when +calling `ko apply` or `ko resolve`, pass `--strict`. If a string +with the `ko://` prefix is not determined to be a valid import path, the +command will fail, rather than passing it through to the resolved YAML. + ## With `minikube` You can use `ko` with `minikube` via a Docker Registry, but this involves