Merge pull request #12159 from yadneshk/osp_get_cluster

Incorrect url to the swift container
This commit is contained in:
Kubernetes Prow Robot 2021-08-18 00:42:09 -07:00 committed by GitHub
commit 80b9359500
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -487,7 +487,7 @@ func (p *SwiftPath) readPath(opt swiftobject.ListOpts) ([]Path, error) {
// ReadDir implements Path::ReadDir.
func (p *SwiftPath) ReadDir() ([]Path, error) {
prefix := p.key
if !strings.HasSuffix(prefix, "/") {
if prefix != "" && !strings.HasSuffix(prefix, "/") {
prefix += "/"
}
opt := swiftobject.ListOpts{
@ -500,7 +500,7 @@ func (p *SwiftPath) ReadDir() ([]Path, error) {
// ReadTree implements Path::ReadTree.
func (p *SwiftPath) ReadTree() ([]Path, error) {
prefix := p.key
if !strings.HasSuffix(prefix, "/") {
if prefix != "" && !strings.HasSuffix(prefix, "/") {
prefix += "/"
}
opt := swiftobject.ListOpts{