Skip to content

Commit

Permalink
Qualify name
Browse files Browse the repository at this point in the history
  • Loading branch information
iwahbe committed Nov 29, 2022
1 parent f56c25c commit 23608c2
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
4 changes: 2 additions & 2 deletions pkg/backend/backend.go
Expand Up @@ -76,8 +76,8 @@ type StackReference interface {
// but that information is not part of the StackName() we pass to the engine.
Name() tokens.Name

// Fully qualified name is the name
FullyQualifiedName() tokens.Name
// Fully qualified name of the stack.
FullyQualifiedName() tokens.QName
}

// PolicyPackReference is an opaque type that refers to a PolicyPack managed by a backend. The CLI
Expand Down
4 changes: 2 additions & 2 deletions pkg/backend/filestate/backend.go
Expand Up @@ -99,8 +99,8 @@ func (r localBackendReference) Name() tokens.Name {
return r.name
}

func (r localBackendReference) FullyQualifiedName() tokens.Name {
return r.Name()
func (r localBackendReference) FullyQualifiedName() tokens.QName {
return r.Name().Q()
}

func IsFileStateBackendURL(urlstr string) bool {
Expand Down
4 changes: 2 additions & 2 deletions pkg/backend/httpstate/stack.go
Expand Up @@ -74,8 +74,8 @@ func (c cloudBackendReference) Name() tokens.Name {
return c.name
}

func (c cloudBackendReference) FullyQualifiedName() tokens.Name {
return tokens.Name(fmt.Sprintf("%v/%v/%v", c.owner, c.project, c.name.String()))
func (c cloudBackendReference) FullyQualifiedName() tokens.QName {
return tokens.IntoQName(fmt.Sprintf("%v/%v/%v", c.owner, c.project, c.name.String()))
}

// cloudStack is a cloud stack descriptor.
Expand Down
5 changes: 2 additions & 3 deletions pkg/cmd/pulumi/about.go
Expand Up @@ -188,7 +188,6 @@ func getSummaryAbout(ctx context.Context, transitiveDependencies bool, selectedS
tmp := getBackendAbout(backend)
result.Backend = &tmp
}

return result
}

Expand Down Expand Up @@ -427,8 +426,8 @@ func (current currentStackAbout) String() string {
}.String() + "\n"
}
stackName := current.Name
if stackName != current.FullyQualifiedName {
stackName += fmt.Sprintf(" (fully qualified to %q)", current.FullyQualifiedName)
if current.FullyQualifiedName != "" {
stackName = current.FullyQualifiedName
}
return fmt.Sprintf("Current Stack: %s\n\n%s\n%s", stackName, resources, pending)
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/pulumi/stack_ls_test.go
Expand Up @@ -82,8 +82,8 @@ func (msr *mockStackReference) Name() tokens.Name {
return tokens.Name(msr.name)
}

func (msr *mockStackReference) FullyQualifiedName() tokens.Name {
return msr.Name()
func (msr *mockStackReference) FullyQualifiedName() tokens.QName {
return msr.Name().Q()
}

func (msr *mockStackReference) String() string {
Expand Down

0 comments on commit 23608c2

Please sign in to comment.