cli: hardcoded namespace used for configmap fetch
pdf opened this issue · comments
What steps did you take and what happened:
Starboard operator is installed in the starboard-system
namespace.
When attempting to initiate a scan from the CLI, the starboard
configmap is always fetched from the starboard
context, ignoring the --namespace
arg:
kubectl starboard --namespace starboard-system -v 10 scan kubehunterreports
I0620 16:38:31.532019 1818720 loader.go:372] Config loaded from file: /home/pdf/.kube/config
I0620 16:38:31.532431 1818720 round_trippers.go:466] curl -v -XGET -H "Accept: application/json, */*" -H "User-Agent: kubectl-starboard/v0.0.0 (linux/amd64) kubernetes/$Format" 'https://127.0.0.1:38697/api/v1/namespaces/starboard/configmaps/starboard'
I0620 16:38:31.532566 1818720 round_trippers.go:510] HTTP Trace: Dial to tcp:127.0.0.1:38697 succeed
I0620 16:38:31.537018 1818720 round_trippers.go:553] GET https://127.0.0.1:38697/api/v1/namespaces/starboard/configmaps/starboard 404 Not Found in 4 milliseconds
I0620 16:38:31.537028 1818720 round_trippers.go:570] HTTP Statistics: DNSLookup 0 ms Dial 0 ms TLSHandshake 3 ms ServerProcessing 0 ms Duration 4 ms
I0620 16:38:31.537033 1818720 round_trippers.go:577] Response Headers:
I0620 16:38:31.537039 1818720 round_trippers.go:580] Content-Length: 198
I0620 16:38:31.537044 1818720 round_trippers.go:580] Date: Mon, 20 Jun 2022 06:38:31 GMT
I0620 16:38:31.537049 1818720 round_trippers.go:580] Audit-Id: fc0ea458-afd5-4536-807f-b0e502e381fb
I0620 16:38:31.537054 1818720 round_trippers.go:580] Cache-Control: no-cache, private
I0620 16:38:31.537059 1818720 round_trippers.go:580] Content-Type: application/json
I0620 16:38:31.537064 1818720 round_trippers.go:580] X-Kubernetes-Pf-Flowschema-Uid: 33721432-5d97-4bfd-be8a-5d6b2f9f48b3
I0620 16:38:31.537070 1818720 round_trippers.go:580] X-Kubernetes-Pf-Prioritylevel-Uid: 7ce02e63-ceff-40ac-be30-8ccadbd3dc59
I0620 16:38:31.537101 1818720 request.go:1073] Response Body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"configmaps \"starboard\" not found","reason":"NotFound","details":{"name":"starboard","kind":"configmaps"},"code":404}
error: configmaps "starboard" not found
What did you expect to happen:
The CLI should respect the provided namespace when retrieving the configmap.
Environment:
- Starboard version (use
starboard version
):
Starboard Version: {Version:0.15.6 Commit:5fc7dd642c6da9b2fa03f66318d344646abe9d5d Date:2022-06-01T15:08:38Z} - Kubernetes version (use
kubectl version
):
Client Version: version.Info{Major:"1", Minor:"24", GitVersion:"v1.24.2", GitCommit:"f66044f4361b9f1f96f0053dd46cb7dce5e990a8", GitTreeState:"archive", BuildDate:"2022-06-18T07:33:51Z", GoVersion:"go1.18.3", Compiler:"gc", Platform:"linux/amd64"}
Kustomize Version: v4.5.4
Server Version: version.Info{Major:"1", Minor:"24", GitVersion:"v1.24.0", GitCommit:"4ce5a8954017644c5420bae81d72b09b735c21f0", GitTreeState:"clean", BuildDate:"2022-05-19T15:39:43Z", GoVersion:"go1.18.1", Compiler:"gc", Platform:"linux/amd64"} - OS (macOS 10.15, Windows 10, Ubuntu 19.10 etc):
Arch Linux.