Warn that watch mode is deprecated (#434)

Also update generated markdown docs, and omit unnecessary autogenerated
bits.
This commit is contained in:
Jason Hall
2021-09-13 10:30:28 -07:00
committed by GitHub
parent 7f145a7e10
commit 35a4d2c28e
13 changed files with 19 additions and 18 deletions
-1
View File
@@ -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
+1 -2
View File
@@ -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
-1
View File
@@ -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
+1 -2
View File
@@ -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
-1
View File
@@ -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
-1
View File
@@ -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
-1
View File
@@ -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
-1
View File
@@ -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
+1 -2
View File
@@ -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
-1
View File
@@ -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
-1
View File
@@ -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
+12 -1
View File
@@ -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 {
+4 -3
View File
@@ -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()
},