Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI noobaa status panics when NooBaa.Status.Accounts.Admin.SecretRef is empty #101

Closed
guymguym opened this issue Oct 24, 2019 · 1 comment
Labels
bug Something isn't working as it should
Milestone

Comments

@guymguym
Copy link
Member

CLI version 2.0.3

> noobaa status
INFO[0000] :white_check_mark: Exists: PersistentVolumeClaim “db-noobaa-core-0”
INFO[0000] :white_check_mark: System Phase is “Ready”
PANI[0000] :skull_and_crossbones:  Panic Attack: [] resource name may not be empty
panic: (*logrus.Entry) (0x190c140,0xc0000949a0)
goroutine 1 [running]:
github.com/sirupsen/logrus.Entry.log(0xc0000e4150, 0xc00040e2d0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
    noobaa-operator/vendor/github.com/sirupsen/logrus/entry.go:239 +0x2db
github.com/sirupsen/logrus.(*Entry).Log(0xc00015e850, 0x0, 0xc00094f570, 0x1, 0x1)
    noobaa-operator/vendor/github.com/sirupsen/logrus/entry.go:268 +0xeb
github.com/sirupsen/logrus.(*Entry).Logf(0xc00015e850, 0x0, 0x195a0b4, 0x1d, 0xc00094f5d0, 0x2, 0x2)
    noobaa-operator/vendor/github.com/sirupsen/logrus/entry.go:314 +0xe2
github.com/sirupsen/logrus.(*Entry).Panicf(...)
    noobaa-operator/vendor/github.com/sirupsen/logrus/entry.go:352
github.com/noobaa/noobaa-operator/v2/pkg/util.Panic(0x1c0b280, 0xc0007be360)
    noobaa-operator/pkg/util/util.go:401 +0xf3
github.com/noobaa/noobaa-operator/v2/pkg/util.KubeCheck(0x1c1d200, 0xc00017f540, 0x195074b)
    noobaa-operator/pkg/util/util.go:290 +0x474
github.com/noobaa/noobaa-operator/v2/pkg/system.RunStatus(0xc0003d4f00, 0xc00041ade0, 0x0, 0x2)
    noobaa-operator/pkg/system/system.go:347 +0x3d5
github.com/noobaa/noobaa-operator/v2/pkg/install.RunStatus(0xc0003d4f00, 0xc00041ade0, 0x0, 0x2)
    noobaa-operator/pkg/install/install.go:110 +0x2c9
github.com/spf13/cobra.(*Command).execute(0xc0003d4f00, 0xc00041ad40, 0x2, 0x2, 0xc0003d4f00, 0xc00041ad40)
    noobaa-operator/vendor/github.com/spf13/cobra/command.go:830 +0x2aa
github.com/spf13/cobra.(*Command).ExecuteC(0xc0003d4500, 0x0, 0x0, 0x0)
    noobaa-operator/vendor/github.com/spf13/cobra/command.go:914 +0x2fb
github.com/spf13/cobra.(*Command).Execute(...)
    noobaa-operator/vendor/github.com/spf13/cobra/command.go:864
github.com/noobaa/noobaa-operator/v2/pkg/cli.Run()
    noobaa-operator/pkg/cli/cli.go:52 +0x27
main.main()
    noobaa-operator/cmd/manager/main.go:14 +0x20
@guymguym guymguym added the bug Something isn't working as it should label Oct 24, 2019
@guymguym
Copy link
Member Author

CC @tamireran

This is caused by a mistake in the operator that left the secretRef empty in NooBaa.Status.Accounts.Admin.SecretRef.

We better fix two things:

  1. The CLI code should be fixed to avoid reading from that status path in order to run the cli status command.
  2. The reconcile code should make sure to set the secretRef in the status.

WORKAROUND

If you get stuck in that crash loop the workaround is to fill the empty secretRef in the noobaa system status, but unfortunately kubectl doesn't support it - see kubernetes/kubectl#564.

So this is the fix using curl:
(just make sure to change the namespace from openshift-storage if you used a different one)

kubectl proxy &
curl -X PATCH '127.0.0.1:8001/apis/noobaa.io/v1alpha1/namespaces/openshift-storage/noobaas/noobaa/status' -d '{"status":{"accounts":{"admin":{"secretRef":{"name":"noobaa-admin","namespace":"openshift-storage"}}}}}' -H "content-type: application/merge-patch+json"
kill %% # stop kubectl proxy

@guymguym guymguym added this to the v2.0.5 milestone Oct 25, 2019
guymguym added a commit to guymguym/noobaa-operator that referenced this issue Oct 27, 2019
guymguym added a commit that referenced this issue Oct 27, 2019
Fixes #101 set the secretRef on noobaa status correctly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as it should
Projects
None yet
Development

No branches or pull requests

1 participant