-
Notifications
You must be signed in to change notification settings - Fork 899
feat(cli): add --provisioner-log-debug
option
#14558
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -127,3 +127,20 @@ func parseParameterMapFile(parameterFile string) (map[string]string, error) { | |
} | ||
return parameterMap, nil | ||
} | ||
|
||
// buildDebugFlags contains options relating to troubleshooting build issues. | ||
type buildDebugFlags struct { | ||
provisioner bool | ||
} | ||
|
||
func (bdf *buildDebugFlags) cliOptions() []serpent.Option { | ||
return []serpent.Option{ | ||
{ | ||
Flag: "debug-provisioner", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We're not so much debugging the provisioner as we're debugging the build via increased provisioner logs. I think we can do a bit better on the naming but I don't have any great ideas. Maybe There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I could just straight-up make it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That still sounds like provisioner debugging IMO, not build debugging 😅 |
||
Description: `Sets the provisioner log level to debug. | ||
This will print additional information about the build process. | ||
This is useful for troubleshooting build issues.`, | ||
Value: serpent.BoolOf(&bdf.provisioner), | ||
}, | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,11 @@ USAGE: | |
Aliases: rm | ||
|
||
OPTIONS: | ||
--debug-provisioner bool | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we keep this flag hidden? I believe this is only for template admins as it may leak some secrets in the TF verbose mode. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm happy to hide it 👍 |
||
Sets the provisioner log level to debug. | ||
This will print additional information about the build process. | ||
This is useful for troubleshooting build issues. | ||
|
||
--orphan bool | ||
Delete a workspace without deleting its resources. This can delete a | ||
workspace in a broken state, but may also lead to unaccounted cloud | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
Could we instead hook into the
CODER_VERBOSE
setting?I'm curious why we need a new setting.
Uh oh!
There was an error while loading. Please reload this page.
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.
Enabling provisioner debug logs is only allowed if
--enable-terraform-debug-mode
is set. Hooking intoCODER_VERBOSE
would potentially make unrelated stuff fail if this was not set.If we did want to re-use this flag, we would need to first fetch the deployment config and check.
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.
I'm not a fan of piggy-backing on verbose either, it essentially changes the behavior of a build, not just the output of the CLI.