Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow pulumi destroy -s <stack> if not in a pulumi project dir #9918

Merged
merged 20 commits into from Jul 11, 2022

Conversation

dixler
Copy link
Contributor

@dixler dixler commented Jun 21, 2022

Description

second time's the charm

Fixes #2440

Checklist

  • I have added tests that prove my fix is effective or that my feature works
  • Yes, there are changes in this PR that warrants bumping the Pulumi Service API version

@dixler
Copy link
Contributor Author

dixler commented Jun 21, 2022

/run-integration-tests

@github-actions
Copy link

Please view the results of the PR Build + Integration Tests Run Here

@dixler dixler marked this pull request as ready for review June 22, 2022 15:14
sm, err := getStackSecretsManager(s)
if err != nil {
return result.FromError(fmt.Errorf("getting secrets manager: %w", err))
// fallback on snapshot SecretsManager
sm = snap.SecretsManager
}

cfg, err := getStackConfiguration(s, sm)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dixler dixler force-pushed the dixler/2440/destroy-stack-specifier branch from efb0bb8 to dd33c7b Compare June 22, 2022 15:20
@dixler dixler requested review from Frassle and t0yv0 June 22, 2022 17:45
@@ -171,7 +171,8 @@ func GetEnvironmentTagsForCurrentStack() (map[apitype.StackTagName]string, error
// Tags based on Pulumi.yaml.
projPath, err := workspace.DetectProjectPath()
if err != nil {
return nil, err
// No current stack return empty
return make(map[apitype.StackTagName]string), nil
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This swallows err perhaps a change to log it instead? Slightly suspicious here

workspace.DetectProjectPath() may return "", nil which does return GetEnvironmentTagsForCurrentStack = empty even before the changes, but the change is still needed to ignore an error. What's the error?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will think more on this.

@t0yv0
Copy link
Member

t0yv0 commented Jun 27, 2022

I've re-tested the example that used to panic.

$ git rev-parse main             ~/pulumi-java
92630cef1a14c6c75663e005243180d63962d3ac

make test_example.minimal

And it passes on top of the latest changes. So that's good.

Changes LGTM.

Do you know what's going on with the failing CI?

Also would need a CHANGELOG entry. Thank you.

@t0yv0 t0yv0 self-requested a review June 29, 2022 18:45
@dixler dixler merged commit 9028a02 into master Jul 11, 2022
@pulumi-bot pulumi-bot deleted the dixler/2440/destroy-stack-specifier branch July 11, 2022 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can pulumi destroy -s <owner>/<project>/<name> work even when Pulumi.yaml is not present?
2 participants