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
Support future glob patterns #11150
Support future glob patterns #11150
Conversation
Changelog[uncommitted] (2022-10-25)Features
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice to get this done 🎉
pkg/resource/deploy/deployment.go
Outdated
} | ||
|
||
// Return if the instance was explicitly created, or if it was default initialized. | ||
func (t UrnTargets) IsInitialized() bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IsInitialized reads a bit odd, maybe IsEmpty? Because NewUrnTargets([]string{})
is initialized but would return false from this method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I'm going to change it to IsConstrained
.
Conceptually, NewUrnTargets([]string{"foo*", "bar"})
is { urn | urn in Urns and (urn = "bar" or urn in expand("foo*")) }
(urn is constrained).
NewUrnTargets([]string{})
is equivalent to { urn | urn in Urns }
(urn is unconstrained).
It would be good to have a test for these new glob creates in pkg/engine/lifecycletest/target_test.go |
Support future glob patterns Improve name for unspecified targets Add a test in target_test
0555d58
to
856bded
Compare
bors r+ |
Build succeeded:
|
Fixes #8956
This changes how the various
--target
globs work. Instead of expanding the glob on the current snapshot, we now push the glob into the engine itself. This allows us to glob on resources not yet created.In exchange for this feature, we give up the ability to reject globs that expand to nothing ahead of running a pulumi up. We gain a much more intuitive interface: globs work as expected, without caveats.