Skip to content
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

Merged
merged 3 commits into from
Jul 14, 2022
Merged

[QTI-284] Allow complex provider configuration #66

merged 3 commits into from
Jul 14, 2022

Conversation

ryancragun
Copy link
Collaborator

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

Checklist

  • The commit message includes an explanation of the changes
  • Manual validation of the changes have been performed (if possible)
  • New or modified code has requisite test coverage (if possible)
  • I have performed a self-review of the changes
  • I have made necessary changes and/or pull requests for documentation
  • I have written useful comments in the code

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>
@ryancragun ryancragun added the changelog/feat New feature or enhancement. Will be included in "New Features" category in release notes. label Jul 13, 2022
@ryancragun ryancragun requested a review from a team as a code owner July 13, 2022 21:48
Signed-off-by: Ryan Cragun <me@ryan.ec>
Copy link
Contributor

@mikebaum mikebaum left a 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
Copy link
Contributor

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
Copy link
Contributor

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.
Copy link
Contributor

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.

@mikebaum mikebaum merged commit e546b8f into main Jul 14, 2022
@mikebaum mikebaum deleted the qti-284 branch July 14, 2022 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog/feat New feature or enhancement. Will be included in "New Features" category in release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants