Skip to content

Kubernetes resources created by the charm must follow RFC1123 naming #64

Description

@addyess

I happened to run across this issue when trying to create a cephfs storage class using the {pool} formatter which will loads the name from the ceph fs pool

lightkube.core.exceptions.ApiError: StorageClass.storage.k8s.io "cephfs-ceph-fs-ceph-fs_data" is invalid: metadata.name: Invalid value: "cephfs-ceph-fs-ceph-fs_data": a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')

the root-cause is that the pool name contained an _ (fs_data)

This is a footgun that's likely to go off in other places. The charm blocked and reported that the use should look at the logs. But the charm could have reported a more clear error

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions