From 35a4d2c28ee35514a062eb18cb145ecc5b832749 Mon Sep 17 00:00:00 2001 From: Jason Hall Date: Mon, 13 Sep 2021 13:30:28 -0400 Subject: [PATCH] Warn that watch mode is deprecated (#434) Also update generated markdown docs, and omit unnecessary autogenerated bits. --- doc/ko.md | 1 - doc/ko_apply.md | 3 +-- doc/ko_completion.md | 1 - doc/ko_create.md | 3 +-- doc/ko_delete.md | 1 - doc/ko_deps.md | 1 - doc/ko_login.md | 1 - doc/ko_publish.md | 1 - doc/ko_resolve.md | 3 +-- doc/ko_run.md | 1 - doc/ko_version.md | 1 - pkg/commands/options/filestuff.go | 13 ++++++++++++- pkg/commands/root.go | 7 ++++--- 13 files changed, 19 insertions(+), 18 deletions(-) diff --git a/doc/ko.md b/doc/ko.md index 6ba8f01fa6..8e66263c4e 100644 --- a/doc/ko.md +++ b/doc/ko.md @@ -25,4 +25,3 @@ ko [flags] * [ko run](ko_run.md) - A variant of `kubectl run` that containerizes IMPORTPATH first. * [ko version](ko_version.md) - Print ko version. -###### Auto generated by spf13/cobra on 10-Aug-2021 diff --git a/doc/ko_apply.md b/doc/ko_apply.md index f28d835439..efef126360 100644 --- a/doc/ko_apply.md +++ b/doc/ko_apply.md @@ -81,11 +81,10 @@ ko apply -f FILENAME [flags] --token string Bearer token for authentication to the API server (DEPRECATED) --user string The name of the kubeconfig user to use (DEPRECATED) --username string Username for basic authentication to the API server (DEPRECATED) - -W, --watch Continuously monitor the transitive dependencies of the passed yaml files, and redeploy whenever anything changes. + -W, --watch Continuously monitor the transitive dependencies of the passed yaml files, and redeploy whenever anything changes. (DEPRECATED) ``` ### SEE ALSO * [ko](ko.md) - Rapidly iterate with Go, Containers, and Kubernetes. -###### Auto generated by spf13/cobra on 10-Aug-2021 diff --git a/doc/ko_completion.md b/doc/ko_completion.md index 314778f17c..cfa18500c4 100644 --- a/doc/ko_completion.md +++ b/doc/ko_completion.md @@ -17,4 +17,3 @@ ko completion [flags] * [ko](ko.md) - Rapidly iterate with Go, Containers, and Kubernetes. -###### Auto generated by spf13/cobra on 10-Aug-2021 diff --git a/doc/ko_create.md b/doc/ko_create.md index a3ab5a88dc..9f95b73e75 100644 --- a/doc/ko_create.md +++ b/doc/ko_create.md @@ -81,11 +81,10 @@ ko create -f FILENAME [flags] --token string Bearer token for authentication to the API server (DEPRECATED) --user string The name of the kubeconfig user to use (DEPRECATED) --username string Username for basic authentication to the API server (DEPRECATED) - -W, --watch Continuously monitor the transitive dependencies of the passed yaml files, and redeploy whenever anything changes. + -W, --watch Continuously monitor the transitive dependencies of the passed yaml files, and redeploy whenever anything changes. (DEPRECATED) ``` ### SEE ALSO * [ko](ko.md) - Rapidly iterate with Go, Containers, and Kubernetes. -###### Auto generated by spf13/cobra on 10-Aug-2021 diff --git a/doc/ko_delete.md b/doc/ko_delete.md index c5feb974da..f97e753b57 100644 --- a/doc/ko_delete.md +++ b/doc/ko_delete.md @@ -16,4 +16,3 @@ ko delete [flags] * [ko](ko.md) - Rapidly iterate with Go, Containers, and Kubernetes. -###### Auto generated by spf13/cobra on 10-Aug-2021 diff --git a/doc/ko_deps.md b/doc/ko_deps.md index 42259bf1bf..085012cd94 100644 --- a/doc/ko_deps.md +++ b/doc/ko_deps.md @@ -30,4 +30,3 @@ ko deps IMAGE [flags] * [ko](ko.md) - Rapidly iterate with Go, Containers, and Kubernetes. -###### Auto generated by spf13/cobra on 10-Aug-2021 diff --git a/doc/ko_login.md b/doc/ko_login.md index 35333d2156..3ed4ee24c3 100644 --- a/doc/ko_login.md +++ b/doc/ko_login.md @@ -26,4 +26,3 @@ ko login [OPTIONS] [SERVER] [flags] * [ko](ko.md) - Rapidly iterate with Go, Containers, and Kubernetes. -###### Auto generated by spf13/cobra on 10-Aug-2021 diff --git a/doc/ko_publish.md b/doc/ko_publish.md index 4eca8d97b7..6923c7ea14 100644 --- a/doc/ko_publish.md +++ b/doc/ko_publish.md @@ -64,4 +64,3 @@ ko publish IMPORTPATH... [flags] * [ko](ko.md) - Rapidly iterate with Go, Containers, and Kubernetes. -###### Auto generated by spf13/cobra on 10-Aug-2021 diff --git a/doc/ko_resolve.md b/doc/ko_resolve.md index ac95db16bb..37349d93bc 100644 --- a/doc/ko_resolve.md +++ b/doc/ko_resolve.md @@ -56,11 +56,10 @@ ko resolve -f FILENAME [flags] --tag-only Include tags but not digests in resolved image references. Useful when digests are not preserved when images are repopulated. -t, --tags strings Which tags to use for the produced image instead of the default 'latest' tag (may not work properly with --base-import-paths or --bare). (default [latest]) --tarball string File to save images tarballs - -W, --watch Continuously monitor the transitive dependencies of the passed yaml files, and redeploy whenever anything changes. + -W, --watch Continuously monitor the transitive dependencies of the passed yaml files, and redeploy whenever anything changes. (DEPRECATED) ``` ### SEE ALSO * [ko](ko.md) - Rapidly iterate with Go, Containers, and Kubernetes. -###### Auto generated by spf13/cobra on 10-Aug-2021 diff --git a/doc/ko_run.md b/doc/ko_run.md index 76243c2b27..ed3a3111ea 100644 --- a/doc/ko_run.md +++ b/doc/ko_run.md @@ -51,4 +51,3 @@ ko run IMPORTPATH [flags] * [ko](ko.md) - Rapidly iterate with Go, Containers, and Kubernetes. -###### Auto generated by spf13/cobra on 10-Aug-2021 diff --git a/doc/ko_version.md b/doc/ko_version.md index 60a2637b5d..2292828d9f 100644 --- a/doc/ko_version.md +++ b/doc/ko_version.md @@ -16,4 +16,3 @@ ko version [flags] * [ko](ko.md) - Rapidly iterate with Go, Containers, and Kubernetes. -###### Auto generated by spf13/cobra on 10-Aug-2021 diff --git a/pkg/commands/options/filestuff.go b/pkg/commands/options/filestuff.go index 4a5c499619..83936b0484 100644 --- a/pkg/commands/options/filestuff.go +++ b/pkg/commands/options/filestuff.go @@ -23,6 +23,16 @@ import ( "github.com/spf13/cobra" ) +const deprecation412 = `NOTICE! +----------------------------------------------------------------- +Watch mode is deprecated and unsupported, and will be removed in +a future release. + +For more information see: + https://github.com/google/ko/issues/412 +----------------------------------------------------------------- +` + // FilenameOptions is from pkg/kubectl. type FilenameOptions struct { Filenames []string @@ -37,7 +47,7 @@ func AddFileArg(cmd *cobra.Command, fo *FilenameOptions) { cmd.Flags().BoolVarP(&fo.Recursive, "recursive", "R", fo.Recursive, "Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.") cmd.Flags().BoolVarP(&fo.Watch, "watch", "W", fo.Watch, - "Continuously monitor the transitive dependencies of the passed yaml files, and redeploy whenever anything changes.") + "Continuously monitor the transitive dependencies of the passed yaml files, and redeploy whenever anything changes. (DEPRECATED)") } // Based heavily on pkg/kubectl @@ -51,6 +61,7 @@ func EnumerateFiles(fo *FilenameOptions) chan string { // interrupt. var watcher *fsnotify.Watcher if fo.Watch { + log.Print(deprecation412) var err error watcher, err = fsnotify.NewWatcher() if err != nil { diff --git a/pkg/commands/root.go b/pkg/commands/root.go index 62d709b8a4..c0f4d4d6b9 100644 --- a/pkg/commands/root.go +++ b/pkg/commands/root.go @@ -23,9 +23,10 @@ var Root = New() func New() *cobra.Command { root := &cobra.Command{ - Use: "ko", - Short: "Rapidly iterate with Go, Containers, and Kubernetes.", - SilenceUsage: true, // Don't show usage on errors + Use: "ko", + Short: "Rapidly iterate with Go, Containers, and Kubernetes.", + SilenceUsage: true, // Don't show usage on errors + DisableAutoGenTag: true, Run: func(cmd *cobra.Command, args []string) { cmd.Help() },