Skip to content

Conversation

@kuba-wolf
Copy link
Contributor

@kuba-wolf kuba-wolf commented Mar 21, 2023

Is this a bug fix or adding new feature?
testing
What is this PR about? / Why do we need it?
Adding sanity testing to the repository
Further update should be made to the FileCache return object for more validation, but that was out of scope for this change
What testing is done?
make tests

Additional Changes made:

  • upgraded aws sdk so now IMDSv2 calls are being made
  • changed Recycle to Retain in the example because Recycle is a deprecated keyword

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 21, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jacobwolfaws

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Mar 21, 2023
LustreConfiguration: "DeploymentType=CACHE_1,PerUnitStorageThroughput=1000,MetadataConfiguration={StorageCapacity=2400}"
copyTagsToDataRepositoryAssociations: "true"
extraTags: "Tag1=Value1,Tag2=Value2"
extraTags: "Name=DynamicProvisioningDemo"
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: could you change this back?

mountOptions:
- flock
persistentVolumeReclaimPolicy: Recycle
persistentVolumeReclaimPolicy: Retain
Copy link
Contributor

Choose a reason for hiding this comment

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

I know that this change is planned but I'm not sure if you wanted to include it here. If you do, could you please expand your original git message to include the context?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think it's big enough to be included in the git message, but I'll make a note of it in the PR

mountOptions:
- flock
persistentVolumeReclaimPolicy: Retain
persistentVolumeReclaimPolicy: Delete
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here for adding context

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will change this back to retain

testFunc func(t *testing.T)
}{
{
//TODO: Expand test checks after adding more values in FileCache object
Copy link
Contributor

Choose a reason for hiding this comment

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

We should add the following tests:

  • create w/ an S3 DRA
  • create w/ an S3 DRA but there's a invalid path so the create fails
  • create w/ NFS but it's missing DNS server IP addresses or Cache path
  • CreateFileCacheWithContext return error

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since this mocks the API call, I don't believe we can have these tests without adding additional checks in the functions themselves. I think we'd have to leave these for e2e testing. CreateFileCacheWithContext return error is also included in this PR

return nil, status.Error(codes.AlreadyExists, err.Error())
default:
return nil, status.Errorf(codes.Internal, "Could not create volume %q: %v")
return nil, status.Errorf(codes.Internal, "Could not create volume %q: %v", volName, err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice!

}

// canSafelySkipMountPointCheck mocks base method.
func (m *MockMounter) canSafelySkipMountPointCheck() bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm confused on the purpose of this method, do you mind clarifying?

Copy link
Contributor Author

@kuba-wolf kuba-wolf Mar 22, 2023

Choose a reason for hiding this comment

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

"Package mocks is a generated GoMock package." This was auto-generated using the hack/update-gomock. Not sure what the specific use-case is here but I think we should leave it

@khoang98
Copy link

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 28, 2023
@k8s-ci-robot k8s-ci-robot merged commit 1be56d7 into kubernetes-sigs:main Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants