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

Fix some bugs of backup_restore tool #333

Merged
merged 4 commits into from Aug 9, 2022

Conversation

loheagn
Copy link
Contributor

@loheagn loheagn commented Aug 5, 2022

  1. try to wait the Configuration object to be created when restore application
  2. don't print the help information when run the backup_restore tool failed
  3. try to read the value of the TERRAFORM_BACKEND_NAMESPACE env from the terraform-controller deployment if user doesn't set it in the local environment

Signed-off-by: loheagn loheagn@icloud.com

Signed-off-by: loheagn <loheagn@icloud.com>
@codecov
Copy link

codecov bot commented Aug 5, 2022

Codecov Report

Merging #333 (5d81c7b) into master (ce3902a) will increase coverage by 1.45%.
The diff coverage is 83.72%.

@@            Coverage Diff             @@
##           master     #333      +/-   ##
==========================================
+ Coverage   75.13%   76.58%   +1.45%     
==========================================
  Files          24       24              
  Lines        1701     1764      +63     
==========================================
+ Hits         1278     1351      +73     
+ Misses        344      335       -9     
+ Partials       79       78       -1     
Flag Coverage Δ
e2e 0.00% <ø> (ø)
unit 79.84% <83.72%> (+1.39%) ⬆️

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

Impacted Files Coverage Δ
controllers/configuration/configuration.go 93.06% <ø> (ø)
controllers/configuration_controller.go 77.71% <83.72%> (+2.83%) ⬆️
controllers/rbac.go 90.66% <0.00%> (+1.33%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us.

Comment on lines 117 to 119
if backendNS != "" {
goto end
}
Copy link
Member

Choose a reason for hiding this comment

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

The logic isn't that complex. Using If Else is enough

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK

log.Printf("WARN: get terraform-controller deployment in the vela-system namesapce failed, %v", err)
return ""
}
envs := deployment.Spec.Template.Spec.Containers[0].Env
Copy link
Member

Choose a reason for hiding this comment

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

Better if we check the container's name?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, you are right.

Signed-off-by: loheagn <loheagn@icloud.com>
…ESPACE` env from terraform-controller deployment

Signed-off-by: loheagn <loheagn@icloud.com>
Signed-off-by: loheagn <loheagn@icloud.com>
@chivalryq chivalryq merged commit 8620dbb into kubevela:master Aug 9, 2022
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.

None yet

2 participants