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

Support for specifying job environment variables #337

Merged
merged 1 commit into from
Aug 15, 2022

Conversation

leason00
Copy link
Member

@leason00 leason00 commented Aug 10, 2022

Fixes: #319

Signed-off-by: lisen lisen@youzan.com

@codecov
Copy link

codecov bot commented Aug 10, 2022

Codecov Report

Merging #337 (a58c296) into master (5d81c7b) will increase coverage by 2.72%.
The diff coverage is 80.00%.

@@            Coverage Diff             @@
##           master     #337      +/-   ##
==========================================
+ Coverage   76.58%   79.31%   +2.72%     
==========================================
  Files          24       23       -1     
  Lines        1764     1750      -14     
==========================================
+ Hits         1351     1388      +37     
+ Misses        335      278      -57     
- Partials       78       84       +6     
Flag Coverage Δ
e2e ?
unit 79.31% <80.00%> (-0.54%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
controllers/configuration/configuration.go 95.40% <ø> (+2.33%) ⬆️
controllers/configuration/backend/kubernetes.go 76.10% <72.72%> (-6.51%) ⬇️
controllers/configuration_controller.go 77.35% <82.14%> (-0.36%) ⬇️
controllers/configuration/backend/backend.go 89.58% <100.00%> (+0.22%) ⬆️
controllers/provider/credentials.go 92.63% <100.00%> (ø)
controllers/provider/ucloud.go 100.00% <100.00%> (ø)
controllers/terraform/status.go 77.41% <100.00%> (ø)
e2e/normal/regression.go

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Member

@chivalryq chivalryq left a comment

Choose a reason for hiding this comment

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

Can you illustrate why we need ProviderVariable in Configuration? How it is related to provider? What's the difference with Credentials in Provider?

controllers/configuration_controller_test.go Outdated Show resolved Hide resolved
controllers/configuration_controller_test.go Outdated Show resolved Hide resolved
controllers/configuration_controller_test.go Outdated Show resolved Hide resolved
controllers/configuration_controller_test.go Outdated Show resolved Hide resolved
controllers/configuration_controller_test.go Outdated Show resolved Hide resolved
@leason00
Copy link
Member Author

Can you illustrate why we need ProviderVariable in Configuration? How it is related to provider? What's the difference with Credentials in Provider?

such as

provider "ucloud" {
  public_key  = "your_public_key"
  private_key = "your_private_key"
  project_id  = "your_project_id"
  region      = "cn-bj2"
}

If I want to create resources in different projects, I need to create multiple Provider。
Just like Region on Configuration. But Region is universal.
Ucloud project_id may not be so universal. so we need ProviderVariable

@leason00 leason00 force-pushed the bugfix_ucloud_region branch 2 times, most recently from c1aadaa to 8e3ae65 Compare August 11, 2022 03:07
controllers/configuration_controller_test.go Outdated Show resolved Hide resolved
controllers/configuration_controller_test.go Outdated Show resolved Hide resolved
controllers/configuration_controller.go Outdated Show resolved Hide resolved
controllers/configuration_controller.go Show resolved Hide resolved
@leason00 leason00 force-pushed the bugfix_ucloud_region branch 2 times, most recently from 4707a34 to 65c99fb Compare August 12, 2022 09:21
@zzxwill
Copy link
Collaborator

zzxwill commented Aug 12, 2022

But we don't have a concept of Provider environment. How could it affect with the properties of a provider?

@leason00
Copy link
Member Author

But we don't have a concept of Provider environment. How could it affect with the properties of a provider?

Add or overwrite

@leason00
Copy link
Member Author

But we don't have a concept of Provider environment. How could it affect with the properties of a provider?

Otherwise, like Ucloud's PrjID, we need to create a lot of Provider, and the secret key is the same, only the PrjID is different, if you need to modify the key, this is a big project.

@chivalryq
Copy link
Member

Would it be better if we extend a env fields for more general purpose? Maybe there are similar issues in the future.

Copy link
Member

@chivalryq chivalryq left a comment

Choose a reason for hiding this comment

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

LGTM after fix these.

controllers/configuration_controller.go Outdated Show resolved Hide resolved
controllers/configuration_controller_test.go Outdated Show resolved Hide resolved
controllers/configuration_controller_test.go Outdated Show resolved Hide resolved
controllers/configuration_controller_test.go Outdated Show resolved Hide resolved
controllers/configuration_controller_test.go Outdated Show resolved Hide resolved
Signed-off-by: lisen <lisen@youzan.com>
Copy link
Member

@chivalryq chivalryq left a comment

Choose a reason for hiding this comment

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

Good job!

@chivalryq chivalryq changed the title Support for specifying Provider environment variables Aug 15, 2022
@chivalryq chivalryq merged commit 989407e into kubevela:master Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants