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

Feat: add new OIDC credentials creation and assigment (vault) #783

Merged
merged 4 commits into from
Jan 15, 2024

Conversation

TomerHeber
Copy link
Collaborator

Issue & Steps to Reproduce / Feature Request

resolves #743

Solution

Last PR for the OIDC effort. This one covers Vault OIDC.

  1. Added new resource and data source.
  2. Added acceptance tests for resource and data source.
  3. Added a new integration test for vault credenitals.
  4. Added examples.
  5. Added some constants in the client layer.

Copy link
Contributor

@Yossi-kerner Yossi-kerner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good left some small comments


provider "env0" {}

variable "second_run" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need this variable?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually want to use it to test updates.
But hadn't applied it to the test. Adding it now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See this is an example:
eef71ed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks like we have some failing tests

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

once you fix those you are good to go

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah I just found out update was never tested.
I'm adding the tests, and fixing the cause for it failing.
I'll push once the tests path. Thanks!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

never tested not just for OIDC... but all AWS, GCP and Azure for all credential types...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you elaborate on how was it missed? So I will be able to catch it faster in the future

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are old tests, written before I started working on this project.
I noticed that var.second_run wasn't used in any of the tests. If it's not used, "update" isn't tested.
For "update" to work properly I had to add "omitempty" to some of the structures (this is why vault failed to pass).

In other words, there were bugs in the provider that were not detected because tests were missing.

I added the tests and fixed the bugs. Now it should all work as expected.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright thanks 😊

@github-actions github-actions bot added ready to merge PR approved - can be merged once the PR owner is ready and removed pending final review labels Jan 15, 2024
@TomerHeber TomerHeber merged commit ccb1e9a into main Jan 15, 2024
7 checks passed
@TomerHeber TomerHeber deleted the feat-add-vault-oidc-cred-#743 branch January 15, 2024 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add new OIDC credentials creation and assigment
2 participants