-
Notifications
You must be signed in to change notification settings - Fork 2
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
[QTI-284] Allow complex provider configuration #66
Conversation
This change modifies how we decode and store provider information passed into from the scenario. Before we would only allow attributes, now we allow any number of attributes and blocks. * Create a schemaless block type to handle decoding blocks that have unknown schema. * Update provider decoder to use a schemaless block for its configuration. * Add kubernetes transport support to enos-provider decoder * Add acceptance test for generation * Update the generator to support schemaless blocks in the provider Signed-off-by: Ryan Cragun <me@ryan.ec>
Signed-off-by: Ryan Cragun <me@ryan.ec>
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.
Just noticed a couple of things, but it looks good. Thanks for the quick turn around on this.
ssh, ok := trans.AsValueMap()["ssh"] | ||
if !ok { | ||
// We're done, we're not going to do anything else with k8s |
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.
s/k8s/ssh/g
return diags | ||
} | ||
|
||
if ssh.IsNull() || !ssh.IsWhollyKnown() || !ssh.CanIterateElements() { | ||
return diags | ||
} | ||
|
||
// We have an ssh transport. Make sure any of the paths that we've been |
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.
Not a big deal, just a question, Why do we validate the transport provider here? Isn't it enough that the enos-provider
does that? If we change the transport we'll need to update this.
s.Type = block.Type | ||
s.Labels = block.Labels | ||
|
||
// We need to cast this to an hclsyntax body to get access to the blocks. |
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.
Ah, when I was looking at the code, this is the magic I was missing.
This change modifies how we decode and store provider information passed
into from the scenario. Before we would only allow attributes, now we
allow any number of attributes and blocks.
unknown schema.
configuration.
Signed-off-by: Ryan Cragun me@ryan.ec
Checklist