Skip to content
This repository was archived by the owner on Jun 29, 2022. It is now read-only.

Ability to use to CSI plugin for Velero. Supports AWS EBS CSI driver. - #1285

Open
Imran Pochi (ipochi) wants to merge 2 commits into
masterfrom
imran/velero-csi-driver
Open

Imran Pochi (ipochi) wants to merge 2 commits into
masterfrom
imran/velero-csi-driver

Conversation

@ipochi

@ipochi Imran Pochi (ipochi) commented Dec 23, 2020

Copy link
Copy Markdown
Member

This adds the ability to create backup and restore with Velero using CSI plugin when Lokomotive is installed on AWS and aws-ebs-csi-driver component is used to dynamically provision volumes

@invidian

Copy link
Copy Markdown
Member

Imran Pochi (@ipochi) component name is aws-ebs-csi-driver, not aws_ebs_csi_driver 馃槈

@invidian Mateusz Gozdek (invidian) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just some nits, overall LGTM

Comment thread pkg/components/velero/component_test.go Outdated
Comment on lines +38 to +41
func (c *Configuration) Validate() hcl.Diagnostics {
return c.validate()
}

// validate validates component configuration
func (c *Configuration) validate() hcl.Diagnostics {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Any reason to have those 2 function separate?

}

// validate validates BackupStorageLocation struct fields.
func (b *BackupStorageLocation) validate() hcl.Diagnostics { // nolint:dupl

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe we could deduplicate the code?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

what do you mean ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I mean:

$ git grep 'BackupStorageLocation) validate'
pkg/components/velero/csi/drivers/aws/aws.go:func (b *BackupStorageLocation) validate() hcl.Diagnostics {
pkg/components/velero/openebs/openebs.go:func (b *BackupStorageLocation) validate(defaultProvider string) hcl.Diagnostics { // nolint:dupl

This code is very similar, we can perhaps put it in separate package and import to avoid duplication.


// Values returns the plugin specific values for Velero Helm chart.
func (c *Configuration) Values() (string, error) {
t := template.Must(template.New("values").Parse(chartValuesTmpl))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If we use template.Must we need to have unit tests to validate the template.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

pkg/components/velero/component_test.go has the tests for each provider.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Oh.. Can we have a tests locally to the package? Otherwise changing code in one package breaks tests in other, this is not nice.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

added unit tests.

Comment thread pkg/components/velero/csi/drivers/aws/aws.go
Imran Pochi added 2 commits January 8, 2021 08:55
This adds the ability to create backup and restore using CSI plugin when
Lokomotive is installed on AWS and `aws_ebs_csi_driver` componnent is
used to dynamically provision volumes.

Signed-off-by: Imran Pochi <imran@kinvolk.io>
Update configuration reference documentation to reflect the new CSI
plugin.

Signed-off-by: Imran Pochi <imran@kinvolk.io>
@surajssd

Copy link
Copy Markdown
Contributor

Imran Pochi (@ipochi) what's the progress on this? Is this being worked on actively?

@ipochi

Copy link
Copy Markdown
Member Author

Suraj Deshmukh (@surajssd) yes.

This would not be part of the 0.6.0 release. I didn't get much time to address the review comments as I am focussing on baremetal platform missing features.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants