Skip to content

Refactor Infra, pkg/provider and GKE provider#413

Merged
geekodour merged 6 commits intoprometheus:masterfrom
geekodour:infra-refactor
Jul 23, 2020
Merged

Refactor Infra, pkg/provider and GKE provider#413
geekodour merged 6 commits intoprometheus:masterfrom
geekodour:infra-refactor

Conversation

@geekodour
Copy link
Contributor

@geekodour geekodour commented Jul 19, 2020

Since we're on our way to add KIND support (#390) and EKS support (#384) for different test-infra components, it makes sense to allow the DeploymentVars to be variable among different providers aswell.

This PR adds some minor refactoring and adds the support for DeploymentVars overriding and adds DefaultDeploymentVars aswell. So that the DefaultDeploymentVars can be overridden by -v. This can also be easily extended to add support for provider specific DeploymentVars (#406)

Here are the things that this PR adds:

  • gke.NewGKEClient be called lazily inside infra
  • Remove GKE.setProjectID and add GKE.checkDeploymentVarsAndFiles to validate input DeploymentVars and DeploymentFiles
  • Add support for default DeploymentVars by adding provider.DeploymentResource
  • Add provider.MergeDeploymentVars and tests which is basically the overriding idea
  • Separate DeploymentVars into FlagDeploymentVars and DefaultDeploymentVars

Todo:

  • E2E test of this. (I did partial test, working as expected)

cc : @rajdas98 @krasi-georgiev @nevill @weastel

* Made call to gke.NewGKEClient lazy
* Add GKE.checkDeploymentVarsAndFiles to validate inputs
* Remov GKE.setProjectID

Signed-off-by: Hrishikesh Barman <hrishikeshbman@gmail.com>
* Add support for default DeploymentVars and DeploymentFiles
* Update gke.New
* Update infra to use provider.DeploymentResource

Signed-off-by: Hrishikesh Barman <hrishikeshbman@gmail.com>
* Add test for provider.MergeDeploymentVars
* Change provider.DefaultDeploymentResource to NewDeploymentResource
* Add provider.MergeDeploymentVars
* Separate FlagDeploymentVars and DefaultDeploymentVars

Signed-off-by: Hrishikesh Barman <hrishikeshbman@gmail.com>
@geekodour geekodour changed the title Refactor Infra, pkg/provider and GKE provider [NOTREADY] Refactor Infra, pkg/provider and GKE provider Jul 19, 2020
Signed-off-by: Hrishikesh Barman <hrishikeshbman@gmail.com>
@geekodour geekodour changed the title [NOTREADY] Refactor Infra, pkg/provider and GKE provider Refactor Infra, pkg/provider and GKE provider Jul 19, 2020
Signed-off-by: Hrishikesh Barman <hrishikeshbman@gmail.com>
Copy link
Contributor

@krasi-georgiev krasi-georgiev left a comment

Choose a reason for hiding this comment

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

LGTM with some small nits

* Update SetupGKEDeploymentResources to SetupDeploymentResources
* Minor refactorings to checkDeploymentVarsAndFiles

Signed-off-by: Hrishikesh Barman <hrishikeshbman@gmail.com>
@geekodour
Copy link
Contributor Author

geekodour commented Jul 21, 2020

Will test this once, will merge if tested. everything seems alright.

@geekodour geekodour merged commit 84dfc08 into prometheus:master Jul 23, 2020
kushalShukla-web pushed a commit to kushalShukla-web/test-infra that referenced this pull request Feb 8, 2025
* Made call to GKE.NewGKEClient lazy
* Remove GKE.setProjectID and add Add GKE.checkDeploymentVarsAndFiles
* Add provider.DeploymentResource with support for default DeploymentVars 
  and FlagDeploymentVars
* Add provider.MergeDeploymentVars and tests
* Add GKE.SetupDeploymentResources which will allow provider specific DeploymentVars

Signed-off-by: Hrishikesh Barman <hrishikeshbman@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants