Quick fix for provider flag ordering (#7412)

* specify plugin arguments before other flags

* Ignore these pesky flags in python provider.main

Co-authored-by: evanboyle <evan@pulumi.com>
This commit is contained in:
Anton Tayanovskyy 2021-07-07 11:07:04 -04:00 committed by GitHub
parent 18401c88b9
commit 36d11261c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 1 deletions

View file

@ -280,6 +280,7 @@ func newPlugin(ctx *Context, pwd, bin, prefix string, args, env []string, option
// execPlugin starts the plugin executable.
func execPlugin(bin string, pluginArgs []string, pwd string, env []string) (*plugin, error) {
var args []string
args = append(args, pluginArgs...)
// Flow the logging information if set.
if logging.LogFlow {
if logging.LogToStderr {
@ -293,7 +294,6 @@ func execPlugin(bin string, pluginArgs []string, pwd string, env []string) (*plu
if cmdutil.TracingEndpoint != "" && !cmdutil.TracingToFile {
args = append(args, "--tracing", cmdutil.TracingEndpoint)
}
args = append(args, pluginArgs...)
cmd := exec.Command(bin, args...)
cmdutil.RegisterProcessGroup(cmd)

View file

@ -189,6 +189,9 @@ def main(provider: Provider, args: List[str]) -> None: # args not in use?
argp = argparse.ArgumentParser(description='Pulumi provider plugin (gRPC server)')
argp.add_argument('engine', help='Pulumi engine address')
argp.add_argument('--logflow', action='store_true', help='Currently ignored')
argp.add_argument('--logtostderr', action='store_true', help='Currently ignored')
engine_address: str = argp.parse_args().engine
async def serve() -> None:

View file

@ -892,6 +892,8 @@ func optsForConstructNode(t *testing.T, expectedResourceCount int, env ...string
},
Quick: true,
NoParallel: true,
// verify that additional flags don't cause the component provider hang
UpdateCommandlineFlags: []string{"--logflow", "--logtostderr"},
ExtraRuntimeValidation: func(t *testing.T, stackInfo integration.RuntimeValidationStackInfo) {
assert.NotNil(t, stackInfo.Deployment)
if assert.Equal(t, expectedResourceCount, len(stackInfo.Deployment.Resources)) {