postgres-operator icon indicating copy to clipboard operation
postgres-operator copied to clipboard

[kubectl-pg] unable to specify the context

Open NickLarsenNZ opened this issue 2 years ago • 0 comments

Please, answer some short questions which should help us to understand your problem / question better?

  • Which image of the operator are you using? v1.8.2
  • Where do you run it - cloud or metal? Kubernetes or OpenShift? AWS K8s
  • Are you running Postgres Operator in production? Not yet, but will
  • Type of issue? Bug report

Some general remarks when posting a bug report:

  • Please, check the operator, pod (Patroni) and postgresql logs first. When copy-pasting many log lines please do it in a separate GitHub gist together with your Postgres CRD and configuration manifest.
  • If you feel this issue might be more related to the Spilo docker image or Patroni, consider opening issues in the respective repos.

I'm trying to use kubectl pg to list clusters in specific contexts, but it doesn't seem possible without setting the default context (which is one too many steps).

Output

If I place it at the beginning, kubectl instructs me to place it after the plugin:

kubectl --context=dev pg list
Error: flags cannot be placed before plugin name: --context=dev

If I place it after the plugin (whether next, or at the end), it isn't recognised:

kubectl pg list --context=dev -A
Error: unknown flag: --context
Usage:
  kubectl-pg list [flags]

Examples:

#Lists postgres cluster in current namespace
kubectl pg list

#Lists postgres clusters in all namespaces
kubectl pg list -A


Flags:
  -A, --all-namespaces     list pg resources across all namespaces.
  -h, --help               help for list
  -n, --namespace string   provide the namespace (default "default")

unknown flag: --context

NickLarsenNZ avatar Jun 22 '22 13:06 NickLarsenNZ