nginxinc / kubernetes-ingress

NGINX and NGINX Plus Ingress Controllers for Kubernetes
https://docs.nginx.com/nginx-ingress-controller
Apache License 2.0
4.65k stars 1.96k forks source link

Unable to use CRDs imported as modules #3770

Open nixx opened 1 year ago

nixx commented 1 year ago

Describe the bug When automating the configuration for NGINX Ingress Controller, we need access to the CRDs. Importing them as a golang module, is preferrable.

To Reproduce Steps to reproduce the behavior: Running " go get -u github.com/nginxinc/kubernetes-ingress" will fail with " require github.com/nginxinc/kubernetes-ingress: version "v3.1.0" invalid: should be v0 or v1, not v3"

This is fixable with adding /v3 in the module name in go.mod.

Expected behavior Expecting to be able to import the module. I do get around it with psedo-versions (go get -u github.com/nginxinc/kubernetes-ingress@v0.0.0-20230414120628-96d28b25e15b)

Your environment v3.1.0 Kubernetes: N/A

github-actions[bot] commented 1 year ago

Hi @nixx thanks for reporting!

Be sure to check out the docs and the Contributing Guidelines while you wait for a human to take a look at this :slightly_smiling_face:

Cheers!

lucacome commented 1 year ago

Hi @nixx the Ingress Controller is not really designed to be imported as a module. Can you share more info about your workflow and how you use it as a module? I think it's the first time we hear about this use case 🙂

jjngx commented 1 year ago

Hi @nixx, Thanks for reporting the issue. We are planning to make the module importable, so packages could be used by referencing v3.

vepatel commented 1 year ago

reopening as merging https://github.com/nginxinc/kubernetes-ingress/pull/4152 is causing local build issue as described in https://github.com/nginxinc/kubernetes-ingress/issues/4324 cc @9bany @jjngx @danielnginx

vepatel commented 10 months ago

https://go.dev/doc/modules/release-workflow https://pkg.go.dev/github.com/nginxinc/kubernetes-ingress

jjngx commented 10 months ago

@nixx which packages do you want to import to your module?

for the ref

jjngx commented 9 months ago

Work on this item can be resumed when we get more information from @nixx, and possible target V4 (version 4.0.0) of the Kubernetes-ingress module.