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

operator status enum not rendered as string #21554

Closed
ostromart opened this issue Feb 26, 2020 · 8 comments
Closed

operator status enum not rendered as string #21554

ostromart opened this issue Feb 26, 2020 · 8 comments

Comments

@ostromart
Copy link
Contributor

@ostromart ostromart commented Feb 26, 2020

There was a change a while back to remove the string representation of status because the enum should be rendered as string. However, I think this means logs, not status, which still shows int:
status:
component_status:
AddonComponents:
status: 3

If that's the case we need to put the status string back (or just change the status to a string) because users will be looking at the CR status not the logs. Could you please verify @morvencao ?

@morvencao

This comment has been minimized.

Copy link
Member

@morvencao morvencao commented Feb 27, 2020

Double checked with latest code and kube version:

# kubectl version
Client Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.3", GitCommit:"b3cbbae08ec52a7fc73d334838e18d17e8512749", GitTreeState:"clean", BuildDate:"2019-11-13T11:23:11Z", GoVersion:"go1.12.12", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.0", GitCommit:"70132b0f130acc0bed193d9ba59dd186f0e634cf", GitTreeState:"clean", BuildDate:"2020-01-14T00:09:19Z", GoVersion:"go1.13.4", Compiler:"gc", Platform:"linux/amd64"}

The status string can be rendered as string:

kubectl get iop
NAME                        AGE
example-istiocontrolplane   25s
# kubectl get iop example-istiocontrolplane -o yaml
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"install.istio.io/v1alpha1","kind":"IstioOperator","metadata":{"annotations":{},"name":"example-istiocontrolplane","namespace":"default"},"spec":{"profile":"demo"}}
  creationTimestamp: "2020-02-27T06:57:04Z"
  finalizers:
  - istio-finalizer.install.istio.io
  generation: 1
  name: example-istiocontrolplane
  namespace: default
  resourceVersion: "1907"
  selfLink: /apis/install.istio.io/v1alpha1/namespaces/default/istiooperators/example-istiocontrolplane
  uid: 0d94e8dc-ea9e-42e1-bb2f-87f7aa06cd65
spec:
  profile: demo
status:
  componentStatus:
    AddonComponents:
      status: HEALTHY
    Base:
      status: HEALTHY
    EgressGateways:
      status: HEALTHY
    IngressGateways:
      status: HEALTHY
    Pilot:
      status: HEALTHY
  status: HEALTHY
@morvencao

This comment has been minimized.

Copy link
Member

@morvencao morvencao commented Feb 27, 2020

@ostromart mentioned this may be relevant with kubectl version, I will investigate that.

@morvencao

This comment has been minimized.

Copy link
Member

@morvencao morvencao commented Feb 27, 2020

Just kubectl version 1.13 and deploy the controller into cluster instead of process, same results:

# ./kubectl version
Client Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.0", GitCommit:"ddf47ac13c1a9483ea035a79cd7c10005ff21a6d", GitTreeState:"clean", BuildDate:"2018-12-03T21:04:45Z", GoVersion:"go1.11.2", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.2", GitCommit:"c97fe5036ef3df2967d086711e6c0c405941e14b", GitTreeState:"clean", BuildDate:"2019-11-11T21:33:58Z", GoVersion:"go1.12.10", Compiler:"gc", Platform:"linux/amd64"}
# ./kubectl -n istio-system get iop example-istiocontrolplane -o yaml
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"install.istio.io/v1alpha1","kind":"IstioOperator","metadata":{"annotations":{},"name":"example-istiocontrolplane","namespace":"istio-system"},"spec":{"profile":"demo"}}
  creationTimestamp: "2020-02-27T07:33:24Z"
  finalizers:
  - istio-finalizer.install.istio.io
  generation: 1
  name: example-istiocontrolplane
  namespace: istio-system
  resourceVersion: "1466"
  selfLink: /apis/install.istio.io/v1alpha1/namespaces/istio-system/istiooperators/example-istiocontrolplane
  uid: 35a89ae2-e162-474b-974e-17ab45d45bf5
spec:
  profile: demo
status:
  componentStatus:
    AddonComponents:
      status: HEALTHY
    Base:
      status: HEALTHY
    EgressGateways:
      status: HEALTHY
    IngressGateways:
      status: HEALTHY
    Pilot:
      status: HEALTHY
  status: HEALTHY
@morvencao

This comment has been minimized.

Copy link
Member

@morvencao morvencao commented Feb 27, 2020

@esnible I heard that you encountered the case a few times that status can't rendered as string, can you provide some info about your env?

@morvencao

This comment has been minimized.

Copy link
Member

@morvencao morvencao commented Mar 5, 2020

@ostromart

I finally reproduced this in release-1.5 branch.
After checking all the changes of operator API, I think this is relevant to istio/api#1263

I tried to build, deploy and test in-cluster operator with and without that PR, the results shows that the status fields need UnmarshalJSON and MarshalJSON function to be marshal/unmarshal normally.

Will cherrypick that PR to release-1.5.

@ostromart

This comment has been minimized.

Copy link
Contributor Author

@ostromart ostromart commented Mar 6, 2020

great! i'm still a bit puzzled why this was not showing up in your environment, but i'm glad you figured out the root cause.

@whitleykeith

This comment has been minimized.

Copy link

@whitleykeith whitleykeith commented Mar 20, 2020

I'm still seeing this issue on 1.5.0. What do I need to do to resolve it?

@morvencao

This comment has been minimized.

Copy link
Member

@morvencao morvencao commented Mar 21, 2020

@whitleykeith I have verified the fix is already in branch release-1.5, so you have to wait for 1.5.1 release.

# git br
  master
* release-1.5
# kubectl -n istio-system get iop example-istiocontrolplane -o yaml
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
metadata:
  creationTimestamp: "2020-03-21T03:52:03Z"
  finalizers:
  - istio-finalizer.install.istio.io
  generation: 1
  name: example-istiocontrolplane
  namespace: istio-system
  resourceVersion: "2574"
  selfLink: /apis/install.istio.io/v1alpha1/namespaces/istio-system/istiooperators/example-istiocontrolplane
  uid: 21006cc4-d0cc-4800-823b-b557a0980467
spec:
  profile: demo
status:
  componentStatus:
    AddonComponents:
      status: HEALTHY
    Base:
      status: HEALTHY
    EgressGateways:
      status: HEALTHY
    IngressGateways:
      status: HEALTHY
    Pilot:
      status: HEALTHY
  status: HEALTHY

I'll close this, reopen if you still have problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.