zalando / zalando/postgres-operator
[kubectl-pg] unable to specify the context
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 5.2k
- Forks
- 1.1k
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 3
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the two kubectl pg commands shown in the issue, then locate the kubectl-pg command entry point and its flag parsing. No file or test is named in the report. Done means a context can be supplied for listing clusters without changing the default context, while the existing namespace and all-namespaces flags continue to work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, kubernetes, postgresql
- Domain
- cli, databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100