Skip to content

Commit

Permalink
kubectl: updates from v0.26.2
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Mar 17, 2023
1 parent c46df8e commit 2f6a879
Show file tree
Hide file tree
Showing 108 changed files with 291 additions and 153 deletions.
1 change: 1 addition & 0 deletions completers/kubectl_completer/cmd/alpha_auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ var alpha_authCmd = &cobra.Command{

func init() {
carapace.Gen(alpha_authCmd).Standalone()

alphaCmd.AddCommand(alpha_authCmd)
}
1 change: 1 addition & 0 deletions completers/kubectl_completer/cmd/alpha_auth_whoami.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ var alpha_auth_whoamiCmd = &cobra.Command{

func init() {
carapace.Gen(alpha_auth_whoamiCmd).Standalone()

alpha_auth_whoamiCmd.Flags().Bool("allow-missing-template-keys", true, "If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.")
alpha_auth_whoamiCmd.Flags().StringP("output", "o", "", "Output format. One of: (json, yaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file).")
alpha_auth_whoamiCmd.Flags().Bool("show-managed-fields", false, "If true, keep the managedFields when printing objects in JSON or YAML format.")
Expand Down
27 changes: 0 additions & 27 deletions completers/kubectl_completer/cmd/alpha_events.go

This file was deleted.

3 changes: 2 additions & 1 deletion completers/kubectl_completer/cmd/annotate.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ import (
)

var annotateCmd = &cobra.Command{
Use: "annotate",
Use: "annotate [--overwrite] (-f FILENAME | TYPE NAME) KEY_1=VAL_1 ... KEY_N=VAL_N [--resource-version=version]",
Short: "Update the annotations on a resource",
GroupID: "settings",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(annotateCmd).Standalone()

annotateCmd.Flags().Bool("all", false, "Select all resources, in the namespace of the specified resource types.")
annotateCmd.Flags().BoolP("all-namespaces", "A", false, "If true, check the specified action in all namespaces.")
annotateCmd.Flags().Bool("allow-missing-template-keys", true, "If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.")
Expand Down
2 changes: 2 additions & 0 deletions completers/kubectl_completer/cmd/apiResources.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ var apiResourcesCmd = &cobra.Command{

func init() {
carapace.Gen(apiResourcesCmd).Standalone()

apiResourcesCmd.Flags().String("api-group", "", "Limit to resources in the specified API group.")
apiResourcesCmd.Flags().Bool("cached", false, "Use the cached list of resources if available.")
apiResourcesCmd.Flags().StringSlice("categories", []string{}, "Limit to resources that belong the the specified categories.")
apiResourcesCmd.Flags().Bool("namespaced", true, "If false, non-namespaced resources will be returned, otherwise returning namespaced resources by default.")
apiResourcesCmd.Flags().Bool("no-headers", false, "When using the default or custom-column output format, don't print headers (default print headers).")
apiResourcesCmd.Flags().StringP("output", "o", "", "Output format. One of: (wide, name).")
Expand Down
3 changes: 2 additions & 1 deletion completers/kubectl_completer/cmd/apiVersions.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ import (

var apiVersionsCmd = &cobra.Command{
Use: "api-versions",
Short: "Print the supported API versions on the server, in the form of \"group/version\"",
Short: "Print the supported API versions on the server, in the form of group/version",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(apiVersionsCmd).Standalone()

rootCmd.AddCommand(apiVersionsCmd)
}
7 changes: 4 additions & 3 deletions completers/kubectl_completer/cmd/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ import (
)

var applyCmd = &cobra.Command{
Use: "apply",
Use: "apply (-f FILENAME | -k DIRECTORY)",
Short: "Apply a configuration to a resource by file name or stdin",
GroupID: "advanced",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(applyCmd).Standalone()

applyCmd.Flags().Bool("all", false, "Select all resources in the namespace of the specified resource types.")
applyCmd.Flags().Bool("allow-missing-template-keys", true, "If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.")
applyCmd.Flags().String("cascade", "background", "Must be \"background\", \"orphan\", or \"foreground\". Selects the deletion cascading strategy for the dependents (e.g. Pods created by a ReplicationController). Defaults to background.")
Expand All @@ -30,13 +31,13 @@ func init() {
applyCmd.Flags().StringP("output", "o", "", "Output format. One of: (json, yaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file).")
applyCmd.Flags().Bool("overwrite", true, "Automatically resolve conflicts between the modified and live configuration by using values from the modified configuration")
applyCmd.Flags().Bool("prune", false, "Automatically delete resource objects, that do not appear in the configs and are created by either apply or create --save-config. Should be used with either -l or --all.")
applyCmd.Flags().StringArray("prune-whitelist", []string{}, "Overwrite the default whitelist with <group/version/kind> for --prune")
applyCmd.Flags().StringArray("prune-allowlist", []string{}, "Overwrite the default allowlist with <group/version/kind> for --prune")
applyCmd.Flags().BoolP("recursive", "R", false, "Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.")
applyCmd.Flags().StringP("selector", "l", "", "Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2). Matching objects must satisfy all of the specified label constraints.")
applyCmd.Flags().Bool("server-side", false, "If true, apply runs in the server instead of the client.")
applyCmd.Flags().Bool("show-managed-fields", false, "If true, keep the managedFields when printing objects in JSON or YAML format.")
applyCmd.Flags().String("template", "", "Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].")
applyCmd.Flags().String("timeout", "0s", "The length of time to wait before giving up on a delete, zero means determine a timeout from the size of the object")
applyCmd.Flags().Duration("timeout", 0, "The length of time to wait before giving up on a delete, zero means determine a timeout from the size of the object")
applyCmd.Flags().String("validate", "strict", "Must be one of: strict (or true), warn, ignore (or false).")
applyCmd.Flags().Bool("wait", false, "If true, wait for resources to be gone before returning. This waits for finalizers.")
applyCmd.Flag("cascade").NoOptDefVal = "background"
Expand Down
3 changes: 2 additions & 1 deletion completers/kubectl_completer/cmd/apply_editLastApplied.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ import (
)

var apply_editLastAppliedCmd = &cobra.Command{
Use: "edit-last-applied",
Use: "edit-last-applied (RESOURCE/NAME | -f FILENAME)",
Short: "Edit latest last-applied-configuration annotations of a resource/object",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(apply_editLastAppliedCmd).Standalone()

apply_editLastAppliedCmd.Flags().Bool("allow-missing-template-keys", true, "If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.")
apply_editLastAppliedCmd.Flags().String("field-manager", "kubectl-client-side-apply", "Name of the manager used to track field ownership.")
apply_editLastAppliedCmd.Flags().StringSliceP("filename", "f", []string{}, "Filename, directory, or URL to files to use to edit the resource")
Expand Down
3 changes: 2 additions & 1 deletion completers/kubectl_completer/cmd/apply_setLastApplied.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ import (
)

var apply_setLastAppliedCmd = &cobra.Command{
Use: "set-last-applied",
Use: "set-last-applied -f FILENAME",
Short: "Set the last-applied-configuration annotation on a live object to match the contents of a file",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(apply_setLastAppliedCmd).Standalone()

apply_setLastAppliedCmd.Flags().Bool("allow-missing-template-keys", true, "If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.")
apply_setLastAppliedCmd.Flags().Bool("create-annotation", false, "Will create 'last-applied-configuration' annotations if current objects doesn't have one")
apply_setLastAppliedCmd.Flags().String("dry-run", "none", "Must be \"none\", \"server\", or \"client\". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.")
Expand Down
3 changes: 2 additions & 1 deletion completers/kubectl_completer/cmd/apply_viewLastApplied.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ import (
)

var apply_viewLastAppliedCmd = &cobra.Command{
Use: "view-last-applied",
Use: "view-last-applied (TYPE [NAME | -l label] | TYPE/NAME | -f FILENAME)",
Short: "View the latest last-applied-configuration annotations of a resource/object",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(apply_viewLastAppliedCmd).Standalone()

apply_viewLastAppliedCmd.Flags().Bool("all", false, "Select all resources in the namespace of the specified resource types")
apply_viewLastAppliedCmd.Flags().StringSliceP("filename", "f", []string{}, "Filename, directory, or URL to files that contains the last-applied-configuration annotations")
apply_viewLastAppliedCmd.Flags().StringP("kustomize", "k", "", "Process the kustomization directory. This flag can't be used together with -f or -R.")
Expand Down
5 changes: 3 additions & 2 deletions completers/kubectl_completer/cmd/attach.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@ import (
)

var attachCmd = &cobra.Command{
Use: "attach",
Use: "attach (POD | TYPE/NAME) -c CONTAINER",
Short: "Attach to a running container",
GroupID: "troubleshooting",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(attachCmd).Standalone()

attachCmd.Flags().StringP("container", "c", "", "Container name. If omitted, use the kubectl.kubernetes.io/default-container annotation for selecting the container to be attached or the first container in the pod will be chosen")
attachCmd.Flags().String("pod-running-timeout", "1m0s", "The length of time (like 5s, 2m, or 3h, higher than zero) to wait until at least one pod is running")
attachCmd.Flags().Duration("pod-running-timeout", 0, "The length of time (like 5s, 2m, or 3h, higher than zero) to wait until at least one pod is running")
attachCmd.Flags().BoolP("quiet", "q", false, "Only print output from the remote session")
attachCmd.Flags().BoolP("stdin", "i", false, "Pass stdin to the container")
attachCmd.Flags().BoolP("tty", "t", false, "Stdin is a TTY")
Expand Down
3 changes: 2 additions & 1 deletion completers/kubectl_completer/cmd/auth_canI.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ import (
)

var auth_canICmd = &cobra.Command{
Use: "can-i",
Use: "can-i VERB [TYPE | TYPE/NAME | NONRESOURCEURL]",
Short: "Check whether an action is allowed",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(auth_canICmd).Standalone()

auth_canICmd.Flags().BoolP("all-namespaces", "A", false, "If true, check the specified action in all namespaces.")
auth_canICmd.Flags().Bool("list", false, "If true, prints all allowed actions.")
auth_canICmd.Flags().Bool("no-headers", false, "If true, prints allowed actions without headers")
Expand Down
3 changes: 2 additions & 1 deletion completers/kubectl_completer/cmd/auth_reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ import (
)

var auth_reconcileCmd = &cobra.Command{
Use: "reconcile",
Use: "reconcile -f FILENAME",
Short: "Reconciles rules for RBAC role, role binding, cluster role, and cluster role binding objects",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(auth_reconcileCmd).Standalone()

auth_reconcileCmd.Flags().Bool("allow-missing-template-keys", true, "If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.")
auth_reconcileCmd.Flags().String("dry-run", "none", "Must be \"none\", \"server\", or \"client\". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.")
auth_reconcileCmd.Flags().StringSliceP("filename", "f", []string{}, "Filename, directory, or URL to files identifying the resource to reconcile.")
Expand Down
3 changes: 2 additions & 1 deletion completers/kubectl_completer/cmd/autoscale.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ import (
)

var autoscaleCmd = &cobra.Command{
Use: "autoscale",
Use: "autoscale (-f FILENAME | TYPE NAME | TYPE/NAME) [--min=MINPODS] --max=MAXPODS [--cpu-percent=CPU]",
Short: "Auto-scale a deployment, replica set, stateful set, or replication controller",
GroupID: "deploy",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(autoscaleCmd).Standalone()

autoscaleCmd.Flags().Bool("allow-missing-template-keys", true, "If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.")
autoscaleCmd.Flags().Int32("cpu-percent", -1, "The target average CPU utilization (represented as a percent of requested CPU) over all the pods. If it's not specified or negative, a default autoscaling policy will be used.")
autoscaleCmd.Flags().String("dry-run", "none", "Must be \"none\", \"server\", or \"client\". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.")
Expand Down
2 changes: 1 addition & 1 deletion completers/kubectl_completer/cmd/certificate.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

var certificateCmd = &cobra.Command{
Use: "certificate",
Use: "certificate SUBCOMMAND",
Short: "Modify certificate resources.",
GroupID: "cluster management",
Run: func(cmd *cobra.Command, args []string) {},
Expand Down
3 changes: 2 additions & 1 deletion completers/kubectl_completer/cmd/certificate_approve.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ import (
)

var certificate_approveCmd = &cobra.Command{
Use: "approve",
Use: "approve (-f FILENAME | NAME)",
Short: "Approve a certificate signing request",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(certificate_approveCmd).Standalone()

certificate_approveCmd.Flags().Bool("allow-missing-template-keys", true, "If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.")
certificate_approveCmd.Flags().StringSliceP("filename", "f", []string{}, "Filename, directory, or URL to files identifying the resource to update")
certificate_approveCmd.Flags().Bool("force", false, "Update the CSR even if it is already approved.")
Expand Down
3 changes: 2 additions & 1 deletion completers/kubectl_completer/cmd/certificate_deny.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ import (
)

var certificate_denyCmd = &cobra.Command{
Use: "deny",
Use: "deny (-f FILENAME | NAME)",
Short: "Deny a certificate signing request",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(certificate_denyCmd).Standalone()

certificate_denyCmd.Flags().Bool("allow-missing-template-keys", true, "If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.")
certificate_denyCmd.Flags().StringSliceP("filename", "f", []string{}, "Filename, directory, or URL to files identifying the resource to update")
certificate_denyCmd.Flags().Bool("force", false, "Update the CSR even if it is already denied.")
Expand Down
1 change: 1 addition & 0 deletions completers/kubectl_completer/cmd/clusterInfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ var clusterInfoCmd = &cobra.Command{

func init() {
carapace.Gen(clusterInfoCmd).Standalone()

rootCmd.AddCommand(clusterInfoCmd)
}
3 changes: 2 additions & 1 deletion completers/kubectl_completer/cmd/clusterInfo_dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ var clusterInfo_dumpCmd = &cobra.Command{

func init() {
carapace.Gen(clusterInfo_dumpCmd).Standalone()

clusterInfo_dumpCmd.Flags().BoolP("all-namespaces", "A", false, "If true, dump all namespaces. If true, --namespaces is ignored.")
clusterInfo_dumpCmd.Flags().Bool("allow-missing-template-keys", true, "If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.")
clusterInfo_dumpCmd.Flags().StringSlice("namespaces", []string{}, "A comma separated list of namespaces to dump.")
clusterInfo_dumpCmd.Flags().StringP("output", "o", "json", "Output format. One of: (json, yaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file).")
clusterInfo_dumpCmd.Flags().String("output-directory", "", "Where to output the files. If empty or '-' uses stdout, otherwise creates a directory hierarchy in that directory")
clusterInfo_dumpCmd.Flags().String("pod-running-timeout", "20s", "The length of time (like 5s, 2m, or 3h, higher than zero) to wait until at least one pod is running")
clusterInfo_dumpCmd.Flags().Duration("pod-running-timeout", 0, "The length of time (like 5s, 2m, or 3h, higher than zero) to wait until at least one pod is running")
clusterInfo_dumpCmd.Flags().Bool("show-managed-fields", false, "If true, keep the managedFields when printing objects in JSON or YAML format.")
clusterInfo_dumpCmd.Flags().String("template", "", "Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].")
clusterInfoCmd.AddCommand(clusterInfo_dumpCmd)
Expand Down
5 changes: 3 additions & 2 deletions completers/kubectl_completer/cmd/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@ import (
)

var completionCmd = &cobra.Command{
Use: "completion",
Use: "completion SHELL",
Short: "Output shell completion code for the specified shell (bash, zsh, fish, or powershell)",
GroupID: "settings",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(completionCmd).Standalone()

rootCmd.AddCommand(completionCmd)

carapace.Gen(completionCmd).PositionalCompletion(
carapace.ActionValues("bash", "zsh"),
carapace.ActionValues("bash", "zsh", "fish", "powershell"),
)
}
8 changes: 7 additions & 1 deletion completers/kubectl_completer/cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@ import (
)

var configCmd = &cobra.Command{
Use: "config",
Use: "config SUBCOMMAND",
Short: "Modify kubeconfig files",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(configCmd).Standalone()

configCmd.PersistentFlags().String("kubeconfig", "", "use a particular kubeconfig file")
rootCmd.AddCommand(configCmd)

carapace.Gen(configCmd).FlagCompletion(carapace.ActionMap{
"kubeconfig": carapace.ActionFiles(),
})
}
1 change: 1 addition & 0 deletions completers/kubectl_completer/cmd/config_currentContext.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ var config_currentContextCmd = &cobra.Command{

func init() {
carapace.Gen(config_currentContextCmd).Standalone()

configCmd.AddCommand(config_currentContextCmd)
}
3 changes: 2 additions & 1 deletion completers/kubectl_completer/cmd/config_deleteCluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ import (
)

var config_deleteClusterCmd = &cobra.Command{
Use: "delete-cluster",
Use: "delete-cluster NAME",
Short: "Delete the specified cluster from the kubeconfig",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(config_deleteClusterCmd).Standalone()

configCmd.AddCommand(config_deleteClusterCmd)

carapace.Gen(config_deleteClusterCmd).PositionalCompletion(
Expand Down
Loading

0 comments on commit 2f6a879

Please sign in to comment.