Skip to content

Commit

Permalink
Warn that watch mode is deprecated (ko-build#434)
Browse files Browse the repository at this point in the history
Also update generated markdown docs, and omit unnecessary autogenerated
bits.
  • Loading branch information
imjasonh authored Sep 13, 2021
1 parent 7f145a7 commit 35a4d2c
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 18 deletions.
1 change: 0 additions & 1 deletion doc/ko.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 1 addition & 2 deletions doc/ko_apply.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 change: 0 additions & 1 deletion doc/ko_completion.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 1 addition & 2 deletions doc/ko_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 change: 0 additions & 1 deletion doc/ko_delete.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 change: 0 additions & 1 deletion doc/ko_deps.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 change: 0 additions & 1 deletion doc/ko_login.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 change: 0 additions & 1 deletion doc/ko_publish.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 1 addition & 2 deletions doc/ko_resolve.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 change: 0 additions & 1 deletion doc/ko_run.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 change: 0 additions & 1 deletion doc/ko_version.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
13 changes: 12 additions & 1 deletion pkg/commands/options/filestuff.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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 {
Expand Down
7 changes: 4 additions & 3 deletions pkg/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
},
Expand Down

0 comments on commit 35a4d2c

Please sign in to comment.