Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new integration test for CSI Snapshot Blueprint (#1208)
* Added new function CreateCSISnapshot * Fixed the instantiated values for kubeCli and dynCli * Added waitForReady=true as the default * Added apiGroup snapshot.storage.k8s.io in cluster-role for kanister-operator * Added documentation for Create CSI VolumeSnapshot Func * Changed namespace to a required arg * Rasults of running gofmt * Reverting changes to return type of snapshotter.Create() * Added new function RestoreCSISnapshot * Changed snapShotter -> snapshotter * grouped imports and added the comment for 'waitForReady' * Updates suggested in docs/functions.rst * Changed snapshot name argument to optional argument and added a default value * reviewer comments * Changes suggested in reviewer comments * gofmt update * gofmt update * Fixed failed to render outputartifact template 'snapshotInfo' issue * Updated const comments and function description in documentation * Updated const comments * Updated the return obj for the function * Declared and used const for outputartifact keys * Added documentation for RestoreCSISnapshot function * Minor changes in docs/functions.rst * Updated the rules in clusterrole * Updated the rules in clusterrole * added asterisk again in helm/kanister-operator/templates/rbac.yaml * Updated rules in clusterrole to check Travis CI failure * Created a test suite for CreateCSISanpshot func * Updated the testcase * Resolved the error in testcase * Updated the create snapshot testcase * removed AddKnownTypeWithName * Added test suite for RestoreCSISnapshot func * Updated the CreateCSISnapshot testcase * gofmt update * golang-ci: fixed whitespace * Reviewer comments * Reviewer comments * Updated the testcase for RestoreCSISnapshot function * Updated the testcase for CreateCSiSnapshot function * Updated the createPVC method in testcase * Fixed RBAC YAML * Fixed RBAC YAML * Added the DeleteCSISnapshot function * Added RBAC updates * Added testcase for DeleteCSISnapshot function * gofmt fix * Added documentation for DeleteCSISnapshot function * fixed issue in docs/functions.rst * Updated the namespace in testcase * Added default context timeout * Fixed the time.Minute issue * Fixed the time.Minute issue * Updated the defer cancel() * Added a custom error for create * Returned the custom error * Updated the error msg * Removed the timeout code snippet * Added validations for volumeMode and accessMode * Removed unnecessary const for default timeout and import for time package * Added the DeadlineExceeded error check and corrected the imports * Updated the logic to validate volume mode * context update * context update * Fixed the validateVolumeModeArg method * Updated the testcase for validate methods * Added testcase for arg validation * Added blank spaces * gofmt updates * Added Note in the docs * Added table driven testcases for validate methods * Removed multiple context.Background() calls and removed the validate method calls in main test case * style: Add whitespace in error messages * refactor: Update const names in test files * refactor: Update length of random alphanumeric suffix to 5 characters * refactor: Update const in test file * style: Add CSI Snapshot funcs MySQL example blueprint * style: Updates in the example README * style: Update title * style: typo in Prerequisites * style: Fix multiple typos * style: Update helm command * style: Fix title, blueprint note and 'Backup application data' descripion * style: Remove unnecessary quotation marks * style: Update blueprint note * refactor: Update argument validation methods * style: Fix typo in a comment * fix: Update create blueprint command * style: fix grammatical typos and readme header syntax * style: Fix create blueprint note with correct blueprint file name * style: Update README as per reviewer comments * style: Explain --pvc argument * style: Update introduction as per reviewer comment * refactor: Update call to validate methods in restore unit test * refactor: Update restore test case as per reviewer comment * refactor: Update CreateCSiSnapshot function and the test case * refactor: Revert random alphanumeric string length * fix: gofmt error * refactor: Update CreateCSiSnapshot function and the test case * refactor: Update CreateCSiSnapshot function and the test case * refactor: Update CreateCSiSnapshot function and the test case * refactor: Moved code out of Exec method * chore: Update signature of the restoreCSISnapshot method * refactor: Revert CreateCSISnapshot Func changes in this PR * refactor: Update create snapshot unit test * fix: CI failure * chore: Comment update * Update example README as per reviewer comments * Update KubeOps function to allow create & delete for core group resources * Add test case for KubeOps Delete core group resource * Remove core group permissions from clusterrole * Update KubeOps Delete operation to wait for resource to be deleted * Update testcase for kubeops delete on core group resource * Update KubeOps test to use existing svc spec * Update poll.Wait logic for waiting on delete operation to complete * Fix gofmt issues * Update wait.Poll to poll.Wait method & pass context from parent * Update as per reviewer comments * Update example with Time Log application * Replace namespace mysql with time-log * Handle error from Delete() and add comment for using poll.Wait() * Add waitForResourceDeletion function * Remove redundant check for error * Add integration test for CSI snapshot blueprint * Fix curl not found and unused string return from execCommmand method * Update base build image * Merge kubectl apply statements * Update comment in integration_register.go * Revert createPhase method in kubeops_test.go * Update KubeOps test * Update README as per reviewer comments * Add comment to explain the waitForResourceDeletion function * Separate CSI driver setup in new target * Update in install_csi_hostpath_driver method * Update comment for waitForResourceDeletion * Remove default storageclass patch * Update the default storageclass * Move default storageclass setup from shell script to integration test * Add storageClassName field in PVC manifest of CSISnapshot integration test * Remove patch steps from CSISnapshot integration test * Run CSI driver install before minio setup in Travis CI * Install CSI hostpath driver in kind cluster that we setup in CI (#1212) * Install CSI driver * Update in install_csi_hostpath_driver method * Remove default storageclass patch * Update the default storageclass * Run CSI driver install before minio setup in Travis CI * Remove patch steps from CSISnapshot integration test * Rename test app & convert raw string manifests to Go structs * Add comment for app struct Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
- Loading branch information