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

Is there an easy way to pass a custom domain during create api? #5942

Closed
deepankarm opened this issue Jul 11, 2022 · 4 comments
Closed

Is there an easy way to pass a custom domain during create api? #5942

deepankarm opened this issue Jul 11, 2022 · 4 comments
Assignees
Labels
language/go Issue is related to a Go operator project triage/support Indicates an issue that is a support question.

Comments

@deepankarm
Copy link

Type of question

Open question

Question

How to change domain argument while doing operator-sdk create api --group cache --version v1alpha1 --kind Memcached --resource --controller?

What did you do?

I tried passing --domain during create api command, but it fails with unknown flag: --domain error, as domain is not yet supported.

What did you expect to see?

I'd expect a simpler way to change the domain from my.domain to custom.domain.com

Environment

Operator type:

/language go

Kubernetes cluster type:

$ operator-sdk version

operator-sdk version: "v1.22.0", commit: "9e95050a94577d1f4ecbaeb6c2755a9d2c231289", kubernetes version: "1.24.1", go version: "go1.18.3", GOOS: "linux", GOARCH: "amd64"

$ go version (if language is Go)

go version go1.18.3 linux/amd64

$ kubectl version

Client Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.0", GitCommit:"ab69524f795c42094a6630298ff53f3c3ebab7f4", GitTreeState:"clean", BuildDate:"2021-12-07T18:16:20Z", GoVersion:"go1.17.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"21+", GitVersion:"v1.21.12-eks-a64ea69", GitCommit:"d4336843ba36120e9ed1491fddff5f2fec33eb77", GitTreeState:"clean", BuildDate:"2022-05-12T18:29:27Z", GoVersion:"go1.16.15", Compiler:"gc", Platform:"linux/amd64"}

Additional context

@openshift-ci openshift-ci bot added the language/go Issue is related to a Go operator project label Jul 11, 2022
@varshaprasad96
Copy link
Member

varshaprasad96 commented Jul 11, 2022

@deepankarm - domain is usually constant for a project and is set during initialization. It is not intended to be changed per GVK. What is the reason behind changing it in create api ?

@deepankarm
Copy link
Author

Ah, I see now that it can be set during operator-sdk init. Is there a way to change what was configured during init (maybe using operator-sdk edit ? Changing the same in PROJECT file doesn't seem to work as expected.

@varshaprasad96
Copy link
Member

operator-sdk edit is again intended to switch between multi-group and single group. It doesn't support changing domain afaik. Reference to edit command is same as here: https://book.kubebuilder.io/migration/multi-group.html#single-group-to-multi-group

@asmacdo asmacdo added the triage/support Indicates an issue that is a support question. label Jul 11, 2022
@varshaprasad96
Copy link
Member

varshaprasad96 commented Jul 11, 2022

@deepankarm We had a discussion regarding this during the community meeting. Changing domains or having multiple domains in the project is something which neither Kubebuilder or Operator SDK supports for now. What we support now is:

  1. One domain + One GVK
  2. One domain + Multiple GVKs
  3. One domain + One GK + multiple versions
  4. Combination of any of these but with single domain.

If there is a particular use case wherein you would like to explicitly want multiple domains, could you please explain the motivation and reason behind it. We do have a similar ask from another user on this in upstream project (kubernetes-sigs/kubebuilder#2394). Please feel free to comment in that particular issue since the change would be done there. If you would like to contribute in introducing this feature, we would be happy to support and help. For now, I am closing this issue, please feel free to reopen if you think that the issue is still unresolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
language/go Issue is related to a Go operator project triage/support Indicates an issue that is a support question.
Projects
None yet
Development

No branches or pull requests

3 participants