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

Can't create an API with Kind named DNS #6668

Closed
rajha-korithrien opened this issue Feb 6, 2024 · 4 comments
Closed

Can't create an API with Kind named DNS #6668

rajha-korithrien opened this issue Feb 6, 2024 · 4 comments
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Milestone

Comments

@rajha-korithrien
Copy link

Bug Report

What did you do?

  1. Installed operator-sdk v1.33.0 for macOS via homebrew
  2. Followed the "quickstart" instructions https://sdk.operatorframework.io/docs/building-operators/golang/quickstart/
mkdir memcached-operator
cd memcached-operator
operator-sdk init --domain example.com --repo github.com/example/memcached-operator
  1. Created an API as per the quickstart guide
operator-sdk create api --group cache --version v1alpha1 --kind Memcached --resource --controller
  1. Tried to create an API with a Kind of DNS via:
operator-sdk create api --group cache --version v1alpha1 --kind DNS --resource --controller

which fails with:

Error: failed to create API: unable to inject the resource to "base.go.kubebuilder.io/v4": invalid Plural: []string{"a DNS-1035 label must consist of lower case alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character (e.g. 'my-name',  or '123-abc', regex used for validation is '[a-z](?:[-a-z0-9]*[a-z0-9])?')"}

However CNS and ENS work just fine ;-)

What did you expect to see?

I expected to see the output:

Next: implement your new API and generate the manifests (e.g. CRDs,CRs) with:
$ make manifests

When making my "DNS" api, just like my "CNS" and "ENS" api

What did you see instead? Under which circumstances?

This is what I get when v1.33.0 (which uses go.kubebuilder.io/v4)

Error: failed to create API: unable to inject the resource to "base.go.kubebuilder.io/v4": invalid Plural: []string{"a DNS-1035 label must consist of lower case alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character (e.g. 'my-name',  or '123-abc', regex used for validation is '[a-z](?:[-a-z0-9]*[a-z0-9])?')"}

It seems to work in v1.31.0 (which uses go.kubebuilder.io/v4-alpha)

Environment

Operator type:

go

Kubernetes cluster type:
minikube (but I never get to using it)

$ operator-sdk version

operator-sdk version: "v1.33.0", commit: "542966812906456a8d67cf7284fc6410b104e118", kubernetes version: "v1.27.0", go version: "go1.21.5", GOOS: "darwin", GOARCH: "arm64"

$ go version (if language is Go)

go version go1.21.6 darwin/arm64

$ kubectl version

Client Version: v1.29.1
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.28.3

Possible Solution

Additional context

I can reproduce this on 2 different machines with clean installs of the operator sdk.

@jberkhahn jberkhahn self-assigned this Feb 12, 2024
@jberkhahn jberkhahn added the kind/bug Categorizes issue or PR as related to a bug. label Feb 12, 2024
@jberkhahn jberkhahn added this to the Backlog milestone Feb 12, 2024
@jberkhahn
Copy link
Contributor

Could you please open a corresponding issue in kubebuilder? this needs to be fixed over there and then get pulled into Operator SDK.

@rajha-korithrien
Copy link
Author

I can certainly do that, do I need to figure out how to cause the bug using just Kubebuilder before filing a Kubebuilder bug, or will my reproducer instructions with Operator SDK be sufficient?

@openshift-bot
Copy link

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci openshift-ci bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 13, 2024
@acornett21
Copy link
Contributor

This comes form k8's itself, going to close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Projects
None yet
Development

No branches or pull requests

4 participants