pulumi/pkg/cmd/pulumi
Ian Wahbe 554660b23a
Implement the --exclude-protected feature (#8359)
* Implement the --exclude-protected feature

This piggybacks on the same machinery used by the --target flag. By
examining the stack, we find a list of all resources managed by
Pulumi (in that stack). We then form them into a DAG, and mark all
resources as either protected or unprotected.

A resource is protected it has the `Protect` flag set or is has a child
with the `protect` flag set. It is unprotected otherwise.

We then pass the urns of unprotected resources to the update options
passed to the destroy operation in the same way that `--target` does.

* Update changelog

* Handle providers correctly

* Add integration test

* Protect dependencies of protected resources

* Handle --exclude-protected in separate function

* Simplify implementation via DependencyGraph

* Add TransitiveDependenciesOf

* Cleanup unused functions

* Gate printed message behind !jsonDisplay

* Ensure provider is not `""`

* Clean up documentation (and some code)
2021-11-15 11:45:14 -08:00
..
about.go Update error handling (#8406) 2021-11-12 18:37:17 -08:00
about_test.go Whitespace and grammer 2021-08-30 18:56:02 -07:00
cancel.go Re-add [BREAKING] - Standardize stack select behavior (#6300) (#6840) 2021-04-22 14:10:39 +01:00
config.go Update error handling (#8406) 2021-11-12 18:37:17 -08:00
config_test.go Assertion fix in config key generation (#6902) 2021-08-02 12:22:09 -07:00
console.go [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
convert-trace.go Add a convert-trace command. (#7319) 2021-06-17 14:46:05 -07:00
crypto.go Update error handling (#8406) 2021-11-12 18:37:17 -08:00
crypto_cloud.go [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
crypto_http.go [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
crypto_http_test.go [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
crypto_local.go Update error handling (#8406) 2021-11-12 18:37:17 -08:00
destroy.go Implement the --exclude-protected feature (#8359) 2021-11-15 11:45:14 -08:00
doc.go Document Go packages (#6009) 2021-01-11 11:07:59 -07:00
errors.go [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
gen_completion.go [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
gen_markdown.go [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
import.go Update error handling (#8406) 2021-11-12 18:37:17 -08:00
login.go Update error handling (#8406) 2021-11-12 18:37:17 -08:00
logout.go Update error handling (#8406) 2021-11-12 18:37:17 -08:00
logs.go Update error handling (#8406) 2021-11-12 18:37:17 -08:00
logs_test.go Move pulumi cmd sources into cmd/pulumi. (#4324) 2020-04-07 15:53:20 -07:00
main.go [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
new.go Update error handling (#8406) 2021-11-12 18:37:17 -08:00
new_test.go Update error handling (#8406) 2021-11-12 18:37:17 -08:00
org.go [CLI] Adding the ability to create a default org for backends that support orgs (#8352) 2021-11-12 20:44:51 +02:00
plugin.go [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
plugin_install.go Update error handling (#8406) 2021-11-12 18:37:17 -08:00
plugin_ls.go Update error handling (#8406) 2021-11-12 18:37:17 -08:00
plugin_rm.go Update error handling (#8406) 2021-11-12 18:37:17 -08:00
policy.go [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
policy_disable.go [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
policy_enable.go [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
policy_group_ls.go Paginate backend list operations (#7600) 2021-07-29 13:37:17 -07:00
policy_ls.go Paginate backend list operations (#7600) 2021-07-29 13:37:17 -07:00
policy_new.go Update error handling (#8406) 2021-11-12 18:37:17 -08:00
policy_new_test.go Relax errmsg check (#7482) 2021-07-12 09:05:06 -04:00
policy_publish.go Update error handling (#8406) 2021-11-12 18:37:17 -08:00
policy_rm.go Update error handling (#8406) 2021-11-12 18:37:17 -08:00
policy_validate.go [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
preview.go Update error handling (#8406) 2021-11-12 18:37:17 -08:00
pulumi.go Update error handling (#8406) 2021-11-12 18:37:17 -08:00
pulumi_test.go improve dev version detection (#4732) 2020-06-02 11:51:04 +01:00
query.go Add a convert-trace command. (#7319) 2021-06-17 14:46:05 -07:00
refresh.go Update error handling (#8406) 2021-11-12 18:37:17 -08:00
schema.go [codegen/schema] Add a schema checker (#7865) 2021-08-30 19:29:24 -07:00
schema_check.go Update error handling (#8406) 2021-11-12 18:37:17 -08:00
stack.go Re-add [BREAKING] - Standardize stack select behavior (#6300) (#6840) 2021-04-22 14:10:39 +01:00
stack_change_secrets_provider.go Update error handling (#8406) 2021-11-12 18:37:17 -08:00
stack_export.go Update error handling (#8406) 2021-11-12 18:37:17 -08:00
stack_graph.go Update error handling (#8406) 2021-11-12 18:37:17 -08:00
stack_history.go Update error handling (#8406) 2021-11-12 18:37:17 -08:00
stack_import.go Update error handling (#8406) 2021-11-12 18:37:17 -08:00
stack_init.go Update error handling (#8406) 2021-11-12 18:37:17 -08:00
stack_ls.go Update error handling (#8406) 2021-11-12 18:37:17 -08:00
stack_ls_test.go Paginate backend list operations (#7600) 2021-07-29 13:37:17 -07:00
stack_output.go Update error handling (#8406) 2021-11-12 18:37:17 -08:00
stack_output_test.go [cli] - Don't escape special characters when printing JSON (#7593) 2021-07-21 15:16:49 -07:00
stack_rename.go Update error handling (#8406) 2021-11-12 18:37:17 -08:00
stack_rm.go Re-add [BREAKING] - Standardize stack select behavior (#6300) (#6840) 2021-04-22 14:10:39 +01:00
stack_select.go Update error handling (#8406) 2021-11-12 18:37:17 -08:00
stack_tag.go Update error handling (#8406) 2021-11-12 18:37:17 -08:00
state.go Update error handling (#8406) 2021-11-12 18:37:17 -08:00
state_delete.go [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
state_unprotect.go [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
up.go Update error handling (#8406) 2021-11-12 18:37:17 -08:00
up_test.go Move pulumi cmd sources into cmd/pulumi. (#4324) 2020-04-07 15:53:20 -07:00
util.go Update error handling (#8406) 2021-11-12 18:37:17 -08:00
util_test.go [cli] Add the ability to control auto-refresh of stacks by Pulumi.yaml (#8071) 2021-09-29 12:43:48 +03:00
version.go [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
view-trace.go Add a convert-trace command. (#7319) 2021-06-17 14:46:05 -07:00
watch.go Update error handling (#8406) 2021-11-12 18:37:17 -08:00
whoami.go [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00