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

Wrong habitat config, could not be debugged easily #335

Open
surajssd opened this issue Aug 13, 2018 · 1 comment
Open

Wrong habitat config, could not be debugged easily #335

surajssd opened this issue Aug 13, 2018 · 1 comment

Comments

@surajssd
Copy link
Contributor

What's wrong?

When a wrong habitat config is provided using kubectl, it is not very clear if something has gone wrong.

Steps to reproduce

Built it from the current master: 14905cc

$ build-habitat-operator.sh                                                                                                                                                                                 
+ cd /home/hummer/go/src/github.com/habitat-sh/habitat-operator/cmd/habitat-operator
+ go install

and I have this habitat file

$ cat habitat.yml
apiVersion: habitat.sh/v1beta1
kind: Habitat
metadata:
  name: random
# this field could also be left out
spec:
  foo: bar

Which is an invalid file and I expect some errors, but I see no error while creating it:

$ kubectl create -f habitat.yml 
habitat.habitat.sh/random created

Steps to debug

No events reported at all, when checked using kubectl get events.

I see errors only where the operator is being run.
The error being: msg="Habitat could not be synced, requeueing" err="unknown topology: " obj=default/random

$ habitat-operator --kubeconfig ~/.kube/config
ts=2018-08-13T17:58:10.485445153+05:30 level=info msg="created Habitat CRD"
ts=2018-08-13T17:58:10.485664107+05:30 level=info component=controller/v1beta1 msg="Watching Habitat objects"                                                                                                     
ts=2018-08-13T17:58:10.50095929+05:30 level=info msg="Habitat CRD already exists, continuing"
ts=2018-08-13T17:58:10.501139664+05:30 level=info component=controller/v1beta2 msg="Watching Habitat objects"                                                                                                     


ts=2018-08-13T17:59:30.853233346+05:30 level=error component=controller/v1beta1 msg="Habitat could not be synced, requeueing" err="unknown topology: " obj=default/random                                         
ts=2018-08-13T17:59:30.858439017+05:30 level=error component=controller/v1beta1 msg="Habitat could not be synced, requeueing" err="unknown topology: " obj=default/random                                         
ts=2018-08-13T17:59:30.868620135+05:30 level=error component=controller/v1beta1 msg="Habitat could not be synced, requeueing" err="unknown topology: " obj=default/random                                         
ts=2018-08-13T17:59:30.88881805+05:30 level=error component=controller/v1beta1 msg="Habitat could not be synced, requeueing" err="unknown topology: " obj=default/random                                          
ts=2018-08-13T17:59:30.929034506+05:30 level=error component=controller/v1beta1 msg="Habitat could not be synced, requeueing" err="unknown topology: " obj=default/random                                         
ts=2018-08-13T17:59:31.009246809+05:30 level=error component=controller/v1beta1 msg="Habitat could not be synced, requeueing" err="unknown topology: " obj=default/random                                         
ts=2018-08-13T17:59:31.169442492+05:30 level=error component=controller/v1beta1 msg="Habitat could not be synced, requeueing" err="unknown topology: " obj=default/random                                         
ts=2018-08-13T17:59:31.489618672+05:30 level=error component=controller/v1beta1 msg="Habitat could not be synced, requeueing" err="unknown topology: " obj=default/random                                         
ts=2018-08-13T17:59:32.129864234+05:30 level=error component=controller/v1beta1 msg="Habitat could not be synced, requeueing" err="unknown topology: " obj=default/random                                         
ts=2018-08-13T17:59:33.410042857+05:30 level=error component=controller/v1beta1 msg="Habitat could not be synced, requeueing" err="unknown topology: " obj=default/random                                         
ts=2018-08-13T17:59:35.970280165+05:30 level=error component=controller/v1beta1 msg="Habitat could not be synced, requeueing" err="unknown topology: " obj=default/random                                         
ts=2018-08-13T17:59:41.090486135+05:30 level=error component=controller/v1beta1 msg="Habitat could not be synced, requeueing" err="unknown topology: " obj=default/random                                         
ts=2018-08-13T17:59:51.330690499+05:30 level=error component=controller/v1beta1 msg="Habitat could not be synced, requeueing" err="unknown topology: " obj=default/random                                         
ts=2018-08-13T18:00:10.501855564+05:30 level=error component=controller/v1beta1 msg="Habitat could not be synced, requeueing" err="unknown topology: " obj=default/random                                         
ts=2018-08-13T18:00:11.810923475+05:30 level=error component=controller/v1beta1 msg="Habitat could not be synced, requeueing" err="unknown topology: " obj=default/random                                         
ts=2018-08-13T18:01:10.502015212+05:30 level=error component=controller/v1beta1 msg="Habitat could not be synced, requeueing" err="unknown topology: " obj=default/random

Questions and suggestions

  • Is this the normal behavior? That I have to see logs of operator to figure out what is wrong?

  • Can we have a Status in the CRD? Which tells us state of the CR? Because looking at either of following does not tell anything:

$ kubectl get habitats.habitat.sh random -o yaml
apiVersion: habitat.sh/v1beta1
kind: Habitat
metadata:
  clusterName: ""
  creationTimestamp: 2018-08-13T12:29:30Z
  generation: 1
  name: random
  namespace: default
  resourceVersion: "261044"
  selfLink: /apis/habitat.sh/v1beta1/namespaces/default/habitats/random
  uid: 86f7a3df-9ef4-11e8-ba7d-080027cc5126
spec:
  foo: bar

OR

$ kubectl get habitats.habitat.sh
NAME      CREATED AT
random    4m
  • Or should we error out when the config is being sent to via kubectl to server that the config is wrong?
@surajssd
Copy link
Contributor Author

related #185

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant