feat(hook): support for hook in nfs-provisioner#93
feat(hook): support for hook in nfs-provisioner#93kmova merged 15 commits intoopenebs-archive:developfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #93 +/- ##
===========================================
+ Coverage 47.11% 49.88% +2.77%
===========================================
Files 29 38 +9
Lines 2390 2700 +310
===========================================
+ Hits 1126 1347 +221
- Misses 1185 1250 +65
- Partials 79 103 +24
Continue to review full report at Codecov.
|
To enable hook execution, nfs-provisioner needs to be configured with env var
OPENEBS_IO_NFS_HOOK_CONFIGMAP set to hook Configmap created in nfs-provisioner namespace.
Hook config data must be set under field named "config".
Sample Hook config is as below:
apiVersion: v1
kind: ConfigMap
metadata:
name: hook-config
namespace: openebs
data:
config: |
hooks:
- NFSDeployment:
annotations:
example.io/track: "true"
test.io/owner: teamA
finalizers:
- test.io/tracking-protection
NFSService:
annotations:
example.io/track: "true"
test.io/owner: teamA
finalizers:
- test.io/tracking-protection
backendPV:
annotations:
example.io/track: "true"
test.io/owner: teamA
finalizers:
- test.io/tracking-protection
backendPVC:
annotations:
example.io/track: "true"
test.io/owner: teamA
finalizers:
- test.io/tracking-protection
hookAction: Add
name: createHook
NFSPV:
annotations:
example.io/track: "true"
test.io/owner: teamA
finalizers:
- test.io/tracking-protection
provisioningEvent: Create
- NFSDeployment:
finalizers:
- test.io/tracking-protection
NFSService:
finalizers:
- test.io/tracking-protection
backendPV:
finalizers:
- test.io/tracking-protection
backendPVC:
finalizers:
- test.io/tracking-protection
hookAction: Remove
name: deleteHook
NFSPV:
finalizers:
- test.io/tracking-protection
provisioningEvent: Delete
version: 1.0.0
Signed-off-by: mayank <mayank.patel@mayadata.io>
Signed-off-by: mayank <mayank.patel@mayadata.io>
Signed-off-by: mayank <mayank.patel@mayadata.io>
Signed-off-by: mayank <mayank.patel@mayadata.io>
Signed-off-by: mayank <mayank.patel@mayadata.io>
Signed-off-by: mayank <mayank.patel@mayadata.io>
mittachaitu
left a comment
There was a problem hiding this comment.
Provided few comments.. moreover it looks good
Signed-off-by: mayank <mayank.patel@mayadata.io>
…into hook Signed-off-by: mayank <mayank.patel@mayadata.io>
Signed-off-by: mayank <mayank.patel@mayadata.io>
…into hook Signed-off-by: mayank <mayank.patel@mayadata.io>
mittachaitu
left a comment
There was a problem hiding this comment.
can we update the example in the description (provisioingingEvent --> eventType, hookAction --> actionType and corresponding values)?
…into hook Signed-off-by: mayank <mayank.patel@mayadata.io>
…thub.com/openebs/dynamic-nfs-provisioner/blob/9ee2e6a51e058891c2f5f5470391e06351e2893b/docs/design/hooks.md) Signed-off-by: mayank <mayank.patel@mayadata.io>
Signed-off-by: mayank <mayank.patel@mayadata.io>
mittachaitu
left a comment
There was a problem hiding this comment.
changes look good but there is a small comment about naming conventions
Signed-off-by: mayank <mayank.patel@mayadata.io>
kmova
left a comment
There was a problem hiding this comment.
Looks good for initial implementation and to follow up with integration tests that cover scenarios like handling provisioning cases that don't go till the point of successfully creating and adding hooks.
Why is this PR required? What issue does it fix?:
This PR implements hooks to configure nfs resources on provisioning and delete.
What this PR does?:
This PR adds support to execute hook on NFS resources during provisioning events.
To enable hook execution, nfs-provisioner needs to be configured with env var
OPENEBS_IO_NFS_HOOK_CONFIGMAP set to hook Configmap created in nfs-provisioner namespace.
Hook config data must be set under a field named
config.Sample Hook config is as below:
Ref:
Does this PR require any upgrade changes?:
No
If the changes in this PR are manually verified, list down the scenarios covered::
Checklist:
<type>(<scope>): <subject>