Skip to content

Commit 8875163

Browse files
mandrestephenfin
andauthored
[manila-csi-plugin] make auth more tolerant (#2758)
Remove dependency on a couple of fields where the logic was wrong. For example, these fields do not necessarily depend on a password being set, as we could be using application credentials. This prevents manila driver from entering an error state when it finds unnecessary fields in the clouds.yaml. It now simply ignores them. Co-authored-by: Stephen Finucane <[email protected]>
1 parent c5d2d2b commit 8875163

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

pkg/client/client.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,21 @@ import (
3838

3939
type AuthOpts struct {
4040
AuthURL string `gcfg:"auth-url" mapstructure:"auth-url" name:"os-authURL" value:"optional" dependsOn:"os-password|os-trustID|os-applicationCredentialSecret|os-clientCertPath"`
41-
UserID string `gcfg:"user-id" mapstructure:"user-id" name:"os-userID" value:"optional" dependsOn:"os-password"`
42-
Username string `name:"os-userName" value:"optional" dependsOn:"os-password"`
43-
Password string `name:"os-password" value:"optional" dependsOn:"os-domainID|os-domainName,os-projectID|os-projectName,os-userID|os-userName"`
44-
TenantID string `gcfg:"tenant-id" mapstructure:"project-id" name:"os-projectID" value:"optional" dependsOn:"os-password|os-clientCertPath"`
45-
TenantName string `gcfg:"tenant-name" mapstructure:"project-name" name:"os-projectName" value:"optional" dependsOn:"os-password|os-clientCertPath"`
41+
UserID string `gcfg:"user-id" mapstructure:"user-id" name:"os-userID" value:"optional"`
42+
Username string `name:"os-userName" value:"optional"`
43+
Password string `name:"os-password" value:"optional"`
44+
TenantID string `gcfg:"tenant-id" mapstructure:"project-id" name:"os-projectID" value:"optional"`
45+
TenantName string `gcfg:"tenant-name" mapstructure:"project-name" name:"os-projectName" value:"optional"`
4646
TrustID string `gcfg:"trust-id" mapstructure:"trust-id" name:"os-trustID" value:"optional"`
4747
TrusteeID string `gcfg:"trustee-id" mapstructure:"trustee-id" name:"os-trusteeID" value:"optional" dependsOn:"os-trustID"`
4848
TrusteePassword string `gcfg:"trustee-password" mapstructure:"trustee-password" name:"os-trusteePassword" value:"optional" dependsOn:"os-trustID"`
49-
DomainID string `gcfg:"domain-id" mapstructure:"domain-id" name:"os-domainID" value:"optional" dependsOn:"os-password|os-clientCertPath"`
50-
DomainName string `gcfg:"domain-name" mapstructure:"domain-name" name:"os-domainName" value:"optional" dependsOn:"os-password|os-clientCertPath"`
49+
DomainID string `gcfg:"domain-id" mapstructure:"domain-id" name:"os-domainID" value:"optional"`
50+
DomainName string `gcfg:"domain-name" mapstructure:"domain-name" name:"os-domainName" value:"optional"`
5151
TenantDomainID string `gcfg:"tenant-domain-id" mapstructure:"project-domain-id" name:"os-projectDomainID" value:"optional"`
5252
TenantDomainName string `gcfg:"tenant-domain-name" mapstructure:"project-domain-name" name:"os-projectDomainName" value:"optional"`
5353
UserDomainID string `gcfg:"user-domain-id" mapstructure:"user-domain-id" name:"os-userDomainID" value:"optional"`
5454
UserDomainName string `gcfg:"user-domain-name" mapstructure:"user-domain-name" name:"os-userDomainName" value:"optional"`
55-
Region string `name:"os-region" value:"optional" dependsOn:"os-password|os-applicationCredentialSecret|os-trusteePassword"`
55+
Region string `name:"os-region" value:"optional"`
5656
EndpointType gophercloud.Availability `gcfg:"os-endpoint-type" mapstructure:"os-endpoint-type" name:"os-endpointType" value:"optional"`
5757
CAFile string `gcfg:"ca-file" mapstructure:"ca-file" name:"os-certAuthorityPath" value:"optional"`
5858
TLSInsecure string `gcfg:"tls-insecure" mapstructure:"tls-insecure" name:"os-TLSInsecure" value:"optional" matches:"^true|false$"`

0 commit comments

Comments
 (0)