Skip to content
This repository has been 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
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ipochi
Copy link
Member

@ipochi ipochi commented Dec 23, 2020

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
Member

@ipochi component name is aws-ebs-csi-driver, not aws_ebs_csi_driver 😉

Copy link
Member

@invidian invidian left a comment

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

pkg/components/velero/component_test.go Outdated Show resolved Hide resolved
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
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
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
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
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
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
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
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
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.

pkg/components/velero/csi/drivers/aws/aws.go Outdated Show resolved Hide resolved
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 <[email protected]>
Update configuration reference documentation to reflect the new CSI
plugin.

Signed-off-by: Imran Pochi <[email protected]>
@surajssd
Copy link
Member

@ipochi what's the progress on this? Is this being worked on actively?

@ipochi
Copy link
Member Author

ipochi commented Jan 13, 2021

@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.

None yet

3 participants