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

unable to build with go version 1.22 #45

Closed
asm582 opened this issue Mar 28, 2024 · 3 comments
Closed

unable to build with go version 1.22 #45

asm582 opened this issue Mar 28, 2024 · 3 comments

Comments

@asm582
Copy link

asm582 commented Mar 28, 2024

The controller gen is unable to create CRDs, below is the stack trace:

#10 exporting to image
#10 exporting layers done
#10 writing image sha256:4e4ab6b47031e93dc06a672c2180a9b2062be80c42a75b8cad8e7d9da691f47c done
#10 naming to registry.example.com/dra-example-driver-build:golang1.20.3 done
#10 DONE 0.0s

What's Next?
  View a summary of image vulnerabilities and recommendations → docker scout quickview
Running 'make generate' in docker container registry.example.com/dra-example-driver-build:golang1.20.3
docker run \
                --rm \
                -e HOME=/Users/abhishekmalvankar/instaslice/0328_exmp_dra/dra-example-driver \
                -e GOCACHE=/Users/abhishekmalvankar/instaslice/0328_exmp_dra/dra-example-driver/.cache/go \
                -e GOPATH=/Users/abhishekmalvankar/instaslice/0328_exmp_dra/dra-example-driver/.cache/gopath \
                -v /Users/abhishekmalvankar/instaslice/0328_exmp_dra/dra-example-driver:/Users/abhishekmalvankar/instaslice/0328_exmp_dra/dra-example-driver \
                -w /Users/abhishekmalvankar/instaslice/0328_exmp_dra/dra-example-driver \
                --user $(id -u):$(id -g) \
                registry.example.com/dra-example-driver-build:golang1.20.3 \
                        make generate
go mod vendor
rm -rf /Users/abhishekmalvankar/instaslice/0328_exmp_dra/dra-example-driver/deployments/helm/dra-example-driver/crds
for api in gpu/nas/v1alpha1 gpu/v1alpha1; do \
        rm -f /Users/abhishekmalvankar/instaslice/0328_exmp_dra/dra-example-driver/api/example.com/resource/${api}/zz_generated.deepcopy.go; \
        controller-gen \
                object:headerFile=/Users/abhishekmalvankar/instaslice/0328_exmp_dra/dra-example-driver/hack/boilerplate.go.txt,year=2024 \
                paths=/Users/abhishekmalvankar/instaslice/0328_exmp_dra/dra-example-driver/api/example.com/resource/${api}/ \
                output:object:dir=/Users/abhishekmalvankar/instaslice/0328_exmp_dra/dra-example-driver/api/example.com/resource/${api}; \
        controller-gen crd:crdVersions=v1 \
                paths=/Users/abhishekmalvankar/instaslice/0328_exmp_dra/dra-example-driver/api/example.com/resource/${api}/ \
                output:crd:dir=/Users/abhishekmalvankar/instaslice/0328_exmp_dra/dra-example-driver/deployments/helm/dra-example-driver/crds; \
done
Error: unable to parse option "object:headerFile=/Users/abhishekmalvankar/instaslice/0328_exmp_dra/dra-example-driver/hack/boilerplate.go.txt,year=2024": [exponent has no digits (at <input>:1:48) '_' must separate successive digits (at <input>:1:48) extra arguments provided: ",year=2024" (at <input>:1:104)]
@asm582
Copy link
Author

asm582 commented Mar 28, 2024

could be the case that I am facing issue as mentioned here: kubernetes-sigs/controller-tools#734

@klueska
Copy link
Contributor

klueska commented Mar 28, 2024

Yes, with go 1.22 you need a newer controller-gen. I have addressed this in the GPU driver for DRA:
NVIDIA/k8s-dra-driver@dfd5e3d#diff-7d130815745ac715c909599409a56c063cdb317ace39c926f86f59bf079847c1R29

But it hasn't been addressed here yet as the toolchain here is still on 1.20.

@klueska
Copy link
Contributor

klueska commented Apr 17, 2024

Closed by: #46

@klueska klueska closed this as completed Apr 17, 2024
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

2 participants