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

Valid Tag Values are altered in created resources #2245

Closed
mroger-mtb opened this issue Mar 28, 2024 · 2 comments · Fixed by #2246
Closed

Valid Tag Values are altered in created resources #2245

mroger-mtb opened this issue Mar 28, 2024 · 2 comments · Fixed by #2246

Comments

@mroger-mtb
Copy link

What happened:
Tag values are being altered inappropriately. Certain valid characters such as '/' are being replaced with '-' when the disk is created.
a tag declared as:
Environment=Dev/Test
is created like so
Environment=Dev-Test

This prevents the resources from being created under tagging policies that have requirements on tag values

What you expected to happen:
the '/' character should not be replaced with '-'

How to reproduce it:
Create a storage class with a tags parameter:

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: disk-tagged-managed
  labels:
    addonmanager.kubernetes.io/mode: EnsureExists
    kubernetes.io/cluster-service: 'true'
provisioner: disk.csi.azure.com
parameters:
  cachingmode: ReadOnly
  kind: Managed
  storageaccounttype: StandardSSD_LRS
  tags: Environment=Dev/Test,GL Code=74300-000-700/370,Product=Engage
reclaimPolicy: Delete
allowVolumeExpansion: true
volumeBindingMode: Immediate

then create a PVC is using this storage class,

kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: example
  namespace: default
  annotations:
    volume.beta.kubernetes.io/storage-provisioner: disk.csi.azure.com
    volume.kubernetes.io/storage-provisioner: disk.csi.azure.com
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 8Gi
  storageClassName: disk-tagged-managed
  volumeMode: Filesystem

Anything else we need to know?:

Environment:

  • CSI Driver version:
    image: mcr.microsoft.com/oss/kubernetes-csi/azuredisk-csi:v1.28.6
  • Kubernetes version (use kubectl version):
    Client Version: v1.28.3
    Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
    Server Version: v1.27.7
  • OS (e.g. from /etc/os-release):
  • Kernel (e.g. uname -a):
  • Install tools:
  • Others:
@andyzhangx
Copy link
Member

hi @mroger-mtb
The following characters are not supported in azure tags : <>%&?/.
so that's by design.

@andyzhangx
Copy link
Member

o, I may be wrong, those chars are not allowed in key, but allowed in values, I will fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants