trident icon indicating copy to clipboard operation
trident copied to clipboard

input contains forbidden attributes: [Username Password]

Open stianmathisen opened this issue 7 months ago • 2 comments

Describe` the bug Not allowed to do credentials based authentication within a TridentBackendConfig.

Environment Provide accurate information about the environment to help us reproduce the issue.

  • Trident version: 25.2.1
  • Container runtime: (cri-o://1.31.8-4.rhaos4.18.git2d48ec9.el9)
  • Kubernetes version: v1.31.8
  • Kubernetes orchestrator: OpenShift 4.18.16
  • OS: Red Hat Enterprise Linux CoreOS 418.94.202505271651-0, Kernel: 5.14.0-427.70.1.el9_4.x86_64
  • NetApp backend types: ONTAP NAS

To Reproduce Deploying TridentBackendConfig yaml

apiVersion: trident.netapp.io/v1 kind: TridentBackendConfig metadata: name: backend-tbc-ontap-nas-poc spec: version: 1 backendName: metro_nas_auto_export storageDriverName: ontap-nas managementLIF: our-lif-here svm: our-svm-here username: our-user-here password: our-password-here autoExportCIDRs: - our-cidr-here autoExportPolicy: true

Expected behavior We expected the TridentBackendConfig to deploy without a fault, since we used the official NetApp documentation when writing the TBC, but to no avail.

Error message Failed to create backend: unsupported config error; input contains forbidden attributes: [Password Username]

stianmathisen avatar Jun 12 '25 13:06 stianmathisen

Hi,

the usual method to configure a backend is one in 2 steps. Here is an example:

A secret where you store you credentials

apiVersion: v1
kind: Secret
metadata:
  name: secret-nas-svm-creds
  namespace: trident
type: Opaque
stringData:
  username: vsadmin
  password: Netapp1!

the TBC that refers to the secret:

apiVersion: trident.netapp.io/v1
kind: TridentBackendConfig
metadata:
  name: backend-tbc-nfs
  namespace: trident
spec:
  version: 1
  storageDriverName: ontap-nas
  managementLIF: 192.168.0.133
  backendName: BackendForNFS
  nasType: nfs
  autoExportCIDRs:
  - 192.168.0.0/24
  autoExportPolicy: true
  defaults:
    snapshotDir: 'true'
  credentials:
    name: secret-nas-svm-creds

YvosOnTheHub avatar Jun 12 '25 13:06 YvosOnTheHub

Thank you very much! Now we do not get any errors when deploying the TBC! ❤

stianmathisen avatar Jun 12 '25 13:06 stianmathisen

The Trident documentation has been updated.

torirevilla avatar Jul 09 '25 13:07 torirevilla