GithubHelp home page GithubHelp logo

Comments (4)

ThatsMrTalbot avatar ThatsMrTalbot commented on May 28, 2024

👋 Is there a particular subcommand you are having issues with, looking at it the --context flag exists for subcommands that interact with Kubernetes.

For example:

$ kubectl cert-manager upgrade migrate-api-version --help 2>&1 | grep -- "--context"
      --context string                 The name of the kubeconfig context to use

$ kubectl cert-manager check api --help 2>&1 | grep -- "--context"
      --context string                 The name of the kubeconfig context to use

from cert-manager.

taxilian avatar taxilian commented on May 28, 2024

... huh. It looks like when I was testing it I had the command wrong, and it works if I don't. For example:

$ kubectl cert-manager --context cluster3 check
.... (help stuff)
error: unknown flag: --context

however

$ kubectl cert-manager --context cluster3 check api
The cert-manager API is ready

So it looks like the actual bug is that if there is any syntax error and the context flag is present it will incorrectly report that the flag isn't supported =] much less critical, but confusing.

from cert-manager.

ThatsMrTalbot avatar ThatsMrTalbot commented on May 28, 2024

Yea, the flag is only on the subcommands that talk to Kubernetes.

kubeclt cert-manager check does not, but kubeclt cert-manager check api does.

I think the confusion lies in the fact kubectl has the flag as a "global" flag available everywhere, where the cert-manager plugin does not.

I have noticed an inconsistency in that the kubectl cert-manager experimental install command has a different name for the flag:

kubectl cert-manager experimental install --help 2>&1 | grep context
      --kube-context string             name of the kubeconfig context to use

But that seems like a different issue

from cert-manager.

taxilian avatar taxilian commented on May 28, 2024

I am not familiar enough with the internals to be sure where the error is coming from, but just to be clear here is the full output:

$ kubectl cert-manager --context cluster3 check
Usage: kubectl cert-manager [command]

Available Commands:
  api         Check if the cert-manager API is ready

Flags:
  -h, --help   help for check

Global Flags:
      --log-flush-frequency duration   Maximum number of seconds between log flushes (default 5s)
      --logging-format string          Sets the log format. Permitted formats: "json" (gated by LoggingBetaOptions), "text". (default "text")
  -v, --v Level[=2]                    number for the log level verbosity
      --vmodule pattern=N,...          comma-separated list of pattern=N settings for file-filtered logging (only works for text log format)

Use "kubectl cert-manager [command] --help" for more information about a command.

error: unknown flag: --context

It looks very much like the error "unknown flag: --context" is coming from the cert-manager plugin. Whether that's true or an illusion, I don't know =] Whatever the cause, the result is a help screen which appears to be very clearly explaining that --context is not a valid flag, hence my confusion.

from cert-manager.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.