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

[BUG] Update status.mountTime failed because of null value in K8s 1.18 #1551

Closed
TrafalgarZZZ opened this issue Mar 19, 2022 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@TrafalgarZZZ
Copy link
Member

What is your environment(Kubernetes version, Fluid version, etc.)
Fluid release 0.7 3d66068

Describe the bug
When following the instructions in juicefs runtime demo, it fails with the following error in juicefsruntime-controller:

2022-03-19T17:21:11.519+0800    ERROR   juicefsctl.JuiceFSRuntime       base/setup.go:39        Update runtime status   {"juicefsruntime": "default/jfsdemo", "error": "JuiceFSRuntime.data.fluid.io \"jfsdemo\" is invalid: status.mountTime: Invalid value: \"null\": status.mountTime in body must be of type string: \"null\""}
github.com/fluid-cloudnative/fluid/vendor/github.com/go-logr/zapr.(*zapLogger).Error
        /go/src/github.com/fluid-cloudnative/fluid/vendor/github.com/go-logr/zapr/zapr.go:132
github.com/fluid-cloudnative/fluid/pkg/ddc/juicefs.JuiceFSEngine.SetupMaster
        /go/src/github.com/fluid-cloudnative/fluid/pkg/ddc/juicefs/master.go:104
github.com/fluid-cloudnative/fluid/pkg/ddc/base.(*TemplateEngine).Setup
        /go/src/github.com/fluid-cloudnative/fluid/pkg/ddc/base/setup.go:39
github.com/fluid-cloudnative/fluid/pkg/controllers.(*RuntimeReconciler).ReconcileRuntime
        /go/src/github.com/fluid-cloudnative/fluid/pkg/controllers/runtime_controller.go:219
github.com/fluid-cloudnative/fluid/pkg/controllers.(*RuntimeReconciler).ReconcileInternal
        /go/src/github.com/fluid-cloudnative/fluid/pkg/controllers/runtime_controller.go:139
github.com/fluid-cloudnative/fluid/pkg/controllers/v1alpha1/juicefs.(*JuiceFSRuntimeReconciler).Reconcile
        /go/src/github.com/fluid-cloudnative/fluid/pkg/controllers/v1alpha1/juicefs/juicefsruntime_controller.go:96

Actually, it's a common issue for all the runtime, but now it only affects JuiceFsRuntime. I think the reason is that only juiceFSRuntime CRD is up-to-date and contains the status.mountTime property.

You can find the property in v0.7.0 juicefsruntime crd:
https://github.com/fluid-cloudnative/fluid/blob/master/charts/fluid/v0.7.0/crds/data.fluid.io_juicefsruntimes.yaml#L1085

While you can't find it in other runtime crd:
https://github.com/fluid-cloudnative/fluid/blob/master/charts/fluid/v0.7.0/crds/data.fluid.io_alluxioruntimes.yaml

What you expect to happen:

How to reproduce it
juicefs runtime demo

Additional Information
Related PR:
#1340

@TrafalgarZZZ TrafalgarZZZ added the bug Something isn't working label Mar 19, 2022
@TrafalgarZZZ TrafalgarZZZ changed the title [BUG] Update status.mountTime failed because of null value [BUG] Update status.mountTime failed because of null value in K8s 1.18 Mar 19, 2022
@TrafalgarZZZ
Copy link
Member Author

This problem is fixed in K8s 1.20:

kubernetes/kubernetes#86811 (comment)

While to fully support lower version K8s like 1.18, a possible solution may be changing metav1.Time to *metav1.Time

kubernetes/kubernetes#86811 (comment)

cheyang pushed a commit that referenced this issue Apr 7, 2022
* fix issue 1551, change mounttime to *v1.Time

Signed-off-by: nizifan <[email protected]>

* Address comments && update crd

Signed-off-by: nizifan <[email protected]>

* update crd

Signed-off-by: nizifan <[email protected]>

* Rebuild&generate crd using controller-gen v0.7.0, and add a nil check

Signed-off-by: nizifan <[email protected]>

Co-authored-by: nizifan <[email protected]>
@cheyang cheyang closed this as completed May 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants