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

generated Kubernetes resources : roleBinding.yaml: object name does not conform to Kubernetes naming requirements #12269

Closed
survivant opened this issue Sep 22, 2020 · 7 comments
Assignees
Labels
area/kubernetes kind/bug Something isn't working
Milestone

Comments

@survivant
Copy link
Contributor

I separated kubernetes.yaml into different files in Helm chart format

my app name is : kubernetes-api

The problem is with the name: "kubernetes-api:view"

The naming convention is : https://kubernetes.io/docs/concepts/overview/working-with-objects/names/
contain at most 63 characters
contain only lowercase alphanumeric characters or '-'
start with an alphanumeric character
end with an alphanumeric character

when I try to validate the yaml, I got a error

helm lint (or I used Intellij to validate the yaml file)

Error: 1 chart(s) linted, 1 chart(s) failed
==> Linting chart
[ERROR] templates/roleBinding.yaml: object name does not conform to Kubernetes naming requirements: "kubernetes-api:view"

apiVersion: "rbac.authorization.k8s.io/v1"
kind: "RoleBinding"
metadata:
labels:
{{ include "app.labels" . | indent 4 }}
name: "kubernetes-api:view"
roleRef:
kind: "ClusterRole"
apiGroup: "rbac.authorization.k8s.io"
name: "view"
subjects:

  • kind: "ServiceAccount"
    name: {{ include "app.name" . }}
@survivant survivant added the kind/bug Something isn't working label Sep 22, 2020
@quarkusbot
Copy link

/cc @geoand

@geoand
Copy link
Contributor

geoand commented Sep 22, 2020

@iocanel this seems to come down to how io.dekorate.kubernetes.decorator.AddRoleBindingResourceDecorator generates the name:

String name = Strings.isNotNullOrEmpty(this.name) ? this.name : meta.getName() + ":" + this.role;

Should we change that?

@survivant
Copy link
Contributor Author

instead of ":" . change it to "-" and it will works

@geoand
Copy link
Contributor

geoand commented Sep 22, 2020

@iocanel iocanel self-assigned this Sep 23, 2020
@iocanel
Copy link
Contributor

iocanel commented Sep 23, 2020

Fixing it upstream, will release later today.

@geoand
Copy link
Contributor

geoand commented Sep 23, 2020

Great, thanks!

@geoand
Copy link
Contributor

geoand commented Sep 28, 2020

Fixed by #12278

@geoand geoand closed this as completed Sep 28, 2020
@geoand geoand added this to the 1.9.0 - master milestone Sep 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kubernetes kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants