mirror of
https://github.com/opentffoundation/opentf.git
synced 2025-12-25 01:00:16 -05:00
Add context propagation to Command Meta entrypoint methods (#2735)
Signed-off-by: James Humphries <james@james-humphries.co.uk>
This commit is contained in:
@@ -195,7 +195,7 @@ func (c *InitCommand) Run(args []string) int {
|
||||
}
|
||||
|
||||
// Load just the root module to begin backend and module initialization
|
||||
rootModEarly, earlyConfDiags := c.loadSingleModuleWithTests(path, testsDirectory)
|
||||
rootModEarly, earlyConfDiags := c.loadSingleModuleWithTests(ctx, path, testsDirectory)
|
||||
|
||||
// There may be parsing errors in config loading but these will be shown later _after_
|
||||
// checking for core version requirement errors. Not meeting the version requirement should
|
||||
@@ -251,7 +251,7 @@ func (c *InitCommand) Run(args []string) int {
|
||||
// of provider dependencies.
|
||||
if back != nil {
|
||||
c.ignoreRemoteVersionConflict(back)
|
||||
workspace, err := c.Workspace()
|
||||
workspace, err := c.Workspace(ctx)
|
||||
if err != nil {
|
||||
c.Ui.Error(fmt.Sprintf("Error selecting workspace: %s", err))
|
||||
return 1
|
||||
@@ -284,7 +284,7 @@ func (c *InitCommand) Run(args []string) int {
|
||||
|
||||
// With all of the modules (hopefully) installed, we can now try to load the
|
||||
// whole configuration tree.
|
||||
config, confDiags := c.loadConfigWithTests(path, testsDirectory)
|
||||
config, confDiags := c.loadConfigWithTests(ctx, path, testsDirectory)
|
||||
// configDiags will be handled after the version constraint check, since an
|
||||
// incorrect version of tofu may be producing errors for configuration
|
||||
// constructs added in later versions.
|
||||
@@ -469,7 +469,7 @@ func (c *InitCommand) initCloud(ctx context.Context, root *configs.Module, extra
|
||||
Init: true,
|
||||
}
|
||||
|
||||
back, backDiags := c.Backend(opts, enc.State())
|
||||
back, backDiags := c.Backend(ctx, opts, enc.State())
|
||||
diags = diags.Append(backDiags)
|
||||
return back, true, diags
|
||||
}
|
||||
@@ -552,7 +552,7 @@ the backend configuration is present and valid.
|
||||
Init: true,
|
||||
}
|
||||
|
||||
back, backDiags := c.Backend(opts, enc.State())
|
||||
back, backDiags := c.Backend(ctx, opts, enc.State())
|
||||
diags = diags.Append(backDiags)
|
||||
return back, true, diags
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user