From 5a86cef103b4287813d0f24586b02d316528b829 Mon Sep 17 00:00:00 2001 From: Fraser Waters Date: Tue, 15 Mar 2022 20:18:08 +0000 Subject: [PATCH] Don't load snapshot just to show stack name (#9199) * Don't load snapshot just to show stack name * Add to CHANGELOG --- CHANGELOG_PENDING.md | 5 ++++- pkg/cmd/pulumi/stack.go | 9 +++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index 8e97ce858e9e..e25994318c74 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -4,11 +4,14 @@ - [language/dotnet] - Updated Pulumi dotnet packages to use grpc-dotnet instead of grpc. [#9149](https://github.com/pulumi/pulumi/pull/9149) -- [cli/config] Rename the `config` property in `Pulumi.yaml` to `stackConfigDir`. The `config` key will continue to be supported. +- [cli/config] - Rename the `config` property in `Pulumi.yaml` to `stackConfigDir`. The `config` key will continue to be supported. [#9145](https://github.com/pulumi/pulumi/pull/9145) - [cli/plugins] Add support for downloading plugin from private Pulumi GitHub releases. This also drops the use of the `GITHUB_ACTOR` and `GITHUB_PERSONAL_ACCESS_TOKEN` environment variables for authenticating to github. Only `GITHUB_TOKEN` is now used, but this can be set to a personal access token. [#9185](https://github.com/pulumi/pulumi/pull/9185) + +- [cli] - Speed up `pulumi stack --show-name` by skipping unneeded snapshot loading. + [#9199](https://github.com/pulumi/pulumi/pull/9199) ### Bug Fixes diff --git a/pkg/cmd/pulumi/stack.go b/pkg/cmd/pulumi/stack.go index 93584cc5f256..fdc591c82dae 100644 --- a/pkg/cmd/pulumi/stack.go +++ b/pkg/cmd/pulumi/stack.go @@ -56,16 +56,17 @@ func newStackCmd() *cobra.Command { if err != nil { return err } - snap, err := s.Snapshot(commandContext()) - if err != nil { - return err - } if showStackName { fmt.Printf("%s\n", s.Ref().Name()) return nil } + snap, err := s.Snapshot(commandContext()) + if err != nil { + return err + } + // First print general info about the current stack. fmt.Printf("Current stack is %s:\n", s.Ref())