-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat: adds very basic feature flag capabilities #1058
base: uds-tofu
Are you sure you want to change the base?
Conversation
8a22f25
to
ad7bee7
Compare
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.
Only thing left is handling the flag parsing
if !featureflags.IsEnabled("tofu") { | ||
fmt.Println("The 'plan' command is not enabled. Use the '--feature=tofu' flag or set the FEATURE_FLAG environment variable.") | ||
return nil | ||
} | ||
return useEmbeddedTofu() | ||
}, | ||
DisableFlagParsing: true, |
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.
As you pointed out last week, flagParsing is currently disabled and will need to be handled in some way.
Context: I originally disabled flagParsing so that we can pass all the tofu flags directly as args. If flagParsing is not disabled we will have to manually capture all the flags the user is trying to provide to tofu and forward them along.
chore: touch the src/cmd/bin/tofu file so it exists for tests, schema, and doc validation chore: small hack to appease the linter for embeded files chore: remove unnecessary todo comment initial spike of feature flags Signed-off-by: catsby <clint@defenseunicorns.com> fix license Signed-off-by: catsby <clint@defenseunicorns.com> add feature flag gate to apply/plan stubs Signed-off-by: catsby <clint@defenseunicorns.com>
Signed-off-by: catsby <clint@defenseunicorns.com>
Signed-off-by: catsby <clint@defenseunicorns.com>
Description
Adds very basic
--feature=<thing>
feature flag support. NOTE: when integrating this I found the--feature
flag support is at odds with theDisableFlagParsing
.Note: this PR is opened against the
embed-tofu-binary
branch.Calling
plan
without featuretofu
enabled:With feature
tofu
enabled:Type of change
Checklist before merging