Skip to content

Commit

Permalink
Merge pull request #10030 from olemarkus/openstack-fix-misleading-error
Browse files Browse the repository at this point in the history
Minor fixes to swiftfs.go
  • Loading branch information
k8s-ci-robot authored Oct 9, 2020
2 parents 174ba0e + f6ce70e commit f49b194
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions util/pkg/vfs/swiftfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func NewSwiftClient() (*gophercloud.ServiceClient, error) {
type OpenstackConfig struct {
}

func (_ OpenstackConfig) filename() (string, error) {
func (OpenstackConfig) filename() (string, error) {
name := os.Getenv("OPENSTACK_CREDENTIAL_FILE")
if name != "" {
klog.V(2).Infof("using openstack config found in $OPENSTACK_CREDENTIAL_FILE: %s", name)
Expand Down Expand Up @@ -137,7 +137,7 @@ func (oc OpenstackConfig) GetCredential() (gophercloud.AuthOptions, error) {
// prioritize environment config
env, enverr := openstack.AuthOptionsFromEnv()
if enverr != nil {
klog.Warningf("Could not initialize swift from environment: %v", enverr)
klog.Warningf("Could not initialize OpenStack config from environment: %v", enverr)
// fallback to config file
return oc.getCredentialFromFile()
}
Expand Down Expand Up @@ -165,7 +165,7 @@ func (oc OpenstackConfig) GetRegion() (string, error) {
// TODO: Unsure if this is the correct section for region
values, err := oc.getSection("Global", items)
if err != nil {
return "", fmt.Errorf("Region not provided in OS_REGION_NAME or openstack config section GLOBAL")
return "", fmt.Errorf("region not provided in OS_REGION_NAME or openstack config section GLOBAL")
}
return values["region"], nil
}
Expand Down Expand Up @@ -527,7 +527,7 @@ func (p *SwiftPath) Hash(a hashing.HashAlgorithm) (*hashing.Hash, error) {

md5Bytes, err := hex.DecodeString(md5)
if err != nil {
return nil, fmt.Errorf("Etag was not a valid MD5 sum: %q", md5)
return nil, fmt.Errorf("etag was not a valid MD5 sum: %q", md5)
}

return &hashing.Hash{Algorithm: hashing.HashAlgorithmMD5, HashValue: md5Bytes}, nil
Expand Down

0 comments on commit f49b194

Please sign in to comment.