Skip to content

fix(cspc): cleanup bdcs after deletion or scaledown of cspi#1579

Merged
vishnuitta merged 13 commits intoopenebs-archive:masterfrom
shubham14bajpai:bdc
Jan 27, 2020
Merged

fix(cspc): cleanup bdcs after deletion or scaledown of cspi#1579
vishnuitta merged 13 commits intoopenebs-archive:masterfrom
shubham14bajpai:bdc

Conversation

@shubham14bajpai
Copy link
Copy Markdown
Contributor

@shubham14bajpai shubham14bajpai commented Jan 7, 2020

Signed-off-by: shubham shubham.bajpai@mayadata.io

What this PR does / why we need it:
When a cspi is deleted or the cspc is scaled down by removing a poolSpec the bdcs for the cspi are not cleaned up. This results in stale resource and unwanted claims on bd which can be used by other resources. This PR adds the cleanup of bdcs in such cases.

Sample BDD output:

mayadata:provisioning$ ginkgo --focus=STRIPE  -v -- -kubeconfig=/var/run/kubernetes/admin.kubeconfig 
Running Suite: Test cstor invalid config
========================================
Random Seed: 1579607994
Will run 20 of 38 specs

STEP: waiting for maya-apiserver pod to come into running state
STEP: waiting for openebs-provisioner pod to come into running state
STEP: Verifying 'admission-server' pod status as running
[CSPC] CSTOR STRIPE POOL PROVISIONING AND DownScaling With BDC cleanup  when A CSPC Is Created 
  cStor Pools Should be Provisioned 
  /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_test.go:82
STEP: Preparing A CSPC Object, No Error Should Occur
STEP: Creating A CSPC Object, Desired Number of CSPIs Should Be Created

• [SLOW TEST:13.531 seconds]
[CSPC] CSTOR STRIPE POOL PROVISIONING AND DownScaling With BDC cleanup 
/home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_test.go:39
  when A CSPC Is Created
  /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_test.go:81
    cStor Pools Should be Provisioned 
    /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_test.go:82
------------------------------
[CSPC] CSTOR STRIPE POOL PROVISIONING AND DownScaling With BDC cleanup  when The CSPC Is DownScaled  
  Extra BDCs Should Be Removed
  /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_test.go:91

• [SLOW TEST:5.476 seconds]
[CSPC] CSTOR STRIPE POOL PROVISIONING AND DownScaling With BDC cleanup 
/home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_test.go:39
  when The CSPC Is DownScaled 
  /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_test.go:90
    Extra BDCs Should Be Removed
    /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_test.go:91
------------------------------
[CSPC] CSTOR STRIPE POOL PROVISIONING AND DownScaling With BDC cleanup  when Cleaning up cspc 
  should delete the cspc
  /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/cspc_provisioning_utils_test.go:125

• [SLOW TEST:15.433 seconds]
[CSPC] CSTOR STRIPE POOL PROVISIONING AND DownScaling With BDC cleanup 
/home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_test.go:39
  when Cleaning up cspc
  /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/cspc_provisioning_utils_test.go:124
    should delete the cspc
    /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/cspc_provisioning_utils_test.go:125
------------------------------
SSSSSS
------------------------------
[CSPC] CSTOR STRIPE POOL PROVISIONING AND RECONCILIATION  when A CSPC Is Created 
  cStor Pools Should be Provisioned 
  /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_test.go:45
STEP: Preparing A CSPC Object, No Error Should Occur
STEP: Creating A CSPC Object, Desired Number of CSPIs Should Be Created

• [SLOW TEST:13.505 seconds]
[CSPC] CSTOR STRIPE POOL PROVISIONING AND RECONCILIATION 
/home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_test.go:27
  when A CSPC Is Created
  /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_test.go:44
    cStor Pools Should be Provisioned 
    /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_test.go:45
------------------------------
[CSPC] CSTOR STRIPE POOL PROVISIONING AND RECONCILIATION  when The CSPC Finalizer Is Removed From CSPC 
  The Finalizer Should Come Back As Part Of Reconcilation
  /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_test.go:54
•
------------------------------
[CSPC] CSTOR STRIPE POOL PROVISIONING AND RECONCILIATION  when 1 CSPI Is Deleted 
  1 New CSPI Should Come Up Again
  /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_test.go:67

• [SLOW TEST:5.210 seconds]
[CSPC] CSTOR STRIPE POOL PROVISIONING AND RECONCILIATION 
/home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_test.go:27
  when 1 CSPI Is Deleted
  /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_test.go:64
    1 New CSPI Should Come Up Again
    /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_test.go:67
------------------------------
[CSPC] CSTOR STRIPE POOL PROVISIONING AND RECONCILIATION  when 2 CSPI Is Deleted 
  2 New CSPI Should Come Up Again
  /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_test.go:67

• [SLOW TEST:5.254 seconds]
[CSPC] CSTOR STRIPE POOL PROVISIONING AND RECONCILIATION 
/home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_test.go:27
  when 2 CSPI Is Deleted
  /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_test.go:64
    2 New CSPI Should Come Up Again
    /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_test.go:67
------------------------------
[CSPC] CSTOR STRIPE POOL PROVISIONING AND RECONCILIATION  when 3 CSPI Is Deleted 
  3 New CSPI Should Come Up Again
  /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_test.go:67

• [SLOW TEST:5.599 seconds]
[CSPC] CSTOR STRIPE POOL PROVISIONING AND RECONCILIATION 
/home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_test.go:27
  when 3 CSPI Is Deleted
  /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_test.go:64
    3 New CSPI Should Come Up Again
    /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_test.go:67
------------------------------
[CSPC] CSTOR STRIPE POOL PROVISIONING AND RECONCILIATION  when Cleaning up cspc 
  should delete the cspc
  /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/cspc_provisioning_utils_test.go:125
•
------------------------------
[CSPC-NEGATIVE] CSTOR STRIPE POOL PROVISIONING AND RECONCILIATION  when A CSPC Is Created with CSPC Update error 
  No pool resource will be created  
  /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:43

S [SKIPPING] [0.001 seconds]
[CSPC-NEGATIVE] CSTOR STRIPE POOL PROVISIONING AND RECONCILIATION 
/home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:30
  when A CSPC Is Created with CSPC Update error
  /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:42
    No pool resource will be created   [It]
    /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:43

    Skipping negative cases

    /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:37
------------------------------
[CSPC-NEGATIVE] CSTOR STRIPE POOL PROVISIONING AND RECONCILIATION  when CSPC update error is removed 
  cStor Pools Should be Provisioned 
  /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:59

S [SKIPPING] [0.001 seconds]
[CSPC-NEGATIVE] CSTOR STRIPE POOL PROVISIONING AND RECONCILIATION 
/home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:30
  when CSPC update error is removed
  /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:58
    cStor Pools Should be Provisioned  [It]
    /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:59

    Skipping negative cases

    /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:37
------------------------------
[CSPC-NEGATIVE] CSTOR STRIPE POOL PROVISIONING AND RECONCILIATION  when Cleaning up cspc 
  should delete the cspc
  /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:165

S [SKIPPING] [0.001 seconds]
[CSPC-NEGATIVE] CSTOR STRIPE POOL PROVISIONING AND RECONCILIATION 
/home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:30
  when Cleaning up cspc
  /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:164
    should delete the cspc [It]
    /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:165

    Skipping negative cases

    /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:37
------------------------------
[CSPC-NEGATIVE] CSTOR STRIPE POOL PROVISIONING AND RECONCILIATION  when A CSPC Is Created with CSPI create error 
  No cStor Pools Should be Provisioned 
  /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:75

S [SKIPPING] [0.001 seconds]
[CSPC-NEGATIVE] CSTOR STRIPE POOL PROVISIONING AND RECONCILIATION 
/home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:30
  when A CSPC Is Created with CSPI create error
  /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:74
    No cStor Pools Should be Provisioned  [It]
    /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:75

    Skipping negative cases

    /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:37
------------------------------
[CSPC-NEGATIVE] CSTOR STRIPE POOL PROVISIONING AND RECONCILIATION  when CSPI create error is removed 
  cStor Pools Should be Provisioned 
  /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:91

S [SKIPPING] [0.001 seconds]
[CSPC-NEGATIVE] CSTOR STRIPE POOL PROVISIONING AND RECONCILIATION 
/home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:30
  when CSPI create error is removed
  /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:90
    cStor Pools Should be Provisioned  [It]
    /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:91

    Skipping negative cases

    /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:37
------------------------------
[CSPC-NEGATIVE] CSTOR STRIPE POOL PROVISIONING AND RECONCILIATION  when Cleaning up cspc 
  should delete the cspc
  /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:165

S [SKIPPING] [0.001 seconds]
[CSPC-NEGATIVE] CSTOR STRIPE POOL PROVISIONING AND RECONCILIATION 
/home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:30
  when Cleaning up cspc
  /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:164
    should delete the cspc [It]
    /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:165

    Skipping negative cases

    /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:37
------------------------------
[CSPC-NEGATIVE] CSTOR STRIPE POOL PROVISIONING AND RECONCILIATION  when A CSPC Is Created with deployment create error 
  CSPI should get created but not the corresponding pool deployments
  /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:107

S [SKIPPING] [0.001 seconds]
[CSPC-NEGATIVE] CSTOR STRIPE POOL PROVISIONING AND RECONCILIATION 
/home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:30
  when A CSPC Is Created with deployment create error
  /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:106
    CSPI should get created but not the corresponding pool deployments [It]
    /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:107

    Skipping negative cases

    /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:37
------------------------------
[CSPC-NEGATIVE] CSTOR STRIPE POOL PROVISIONING AND RECONCILIATION  when Deployment create error is removed 
  Pool deployments should come up and corresponding CSPIs should become healthy 
  /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:123

S [SKIPPING] [0.001 seconds]
[CSPC-NEGATIVE] CSTOR STRIPE POOL PROVISIONING AND RECONCILIATION 
/home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:30
  when Deployment create error is removed
  /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:122
    Pool deployments should come up and corresponding CSPIs should become healthy  [It]
    /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:123

    Skipping negative cases

    /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:37
------------------------------
[CSPC-NEGATIVE] CSTOR STRIPE POOL PROVISIONING AND RECONCILIATION  when Cleaning up cspc 
  should delete the cspc
  /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:165

S [SKIPPING] [0.001 seconds]
[CSPC-NEGATIVE] CSTOR STRIPE POOL PROVISIONING AND RECONCILIATION 
/home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:30
  when Cleaning up cspc
  /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:164
    should delete the cspc [It]
    /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:165

    Skipping negative cases

    /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:37
------------------------------
[CSPC-NEGATIVE] CSTOR STRIPE POOL PROVISIONING AND RECONCILIATION  when A CSPC Is Created with 30 % random error injection threshold  
  Pools should get provisioned eventually after all the errors has been ejected
  /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:137

S [SKIPPING] [0.001 seconds]
[CSPC-NEGATIVE] CSTOR STRIPE POOL PROVISIONING AND RECONCILIATION 
/home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:30
  when A CSPC Is Created with 30 % random error injection threshold 
  /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:136
    Pools should get provisioned eventually after all the errors has been ejected [It]
    /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:137

    Skipping negative cases

    /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:37
------------------------------
[CSPC-NEGATIVE] CSTOR STRIPE POOL PROVISIONING AND RECONCILIATION  when Cleaning up cspc 
  should delete the cspc
  /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:165

S [SKIPPING] [0.001 seconds]
[CSPC-NEGATIVE] CSTOR STRIPE POOL PROVISIONING AND RECONCILIATION 
/home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:30
  when Cleaning up cspc
  /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:164
    should delete the cspc [It]
    /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:165

    Skipping negative cases

    /home/mayadata/work/src/github.com/openebs/maya/tests/cstor/cspc/provisioning/provisioning_negative_test.go:37
------------------------------
SSSSSSSSSSSS
Ran 9 of 38 Specs in 65.107 seconds
SUCCESS! -- 9 Passed | 0 Failed | 0 Pending | 29 Skipped
PASS

Ginkgo ran 1 suite in 1m9.083259009s
Test Suite Passed

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #

Special notes for your reviewer:

Checklist:

  • Fixes #
  • Labelled this PR & related issue with documentation tag
  • PR messages has document related information
  • Labelled this PR & related issue with breaking-changes tag
  • PR messages has breaking changes related information
  • Labelled this PR & related issue with requires-upgrade tag
  • PR messages has upgrade related information
  • Commit has unit tests
  • Commit has integration tests

@kmova kmova added this to the 1.7.0 milestone Jan 8, 2020
@shubham14bajpai shubham14bajpai changed the title fix(cspc): cleanup bdcs after deletion or scaledown of cspi WIP fix(cspc): cleanup bdcs after deletion or scaledown of cspi Jan 10, 2020
@shubham14bajpai shubham14bajpai changed the title WIP fix(cspc): cleanup bdcs after deletion or scaledown of cspi fix(cspc): cleanup bdcs after deletion or scaledown of cspi Jan 10, 2020
Copy link
Copy Markdown
Contributor

@sonasingh46 sonasingh46 left a comment

Choose a reason for hiding this comment

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

changes are good.

},
)
if err != nil {
klog.Errorf("failed to list cspi for cspc %s to perform cleanup: %s", cspcObj.Name, err.Error())
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

In the next PR's we can generate an event regarding the error.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Will take this in next PR

Copy link
Copy Markdown

@mittachaitu mittachaitu left a comment

Choose a reason for hiding this comment

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

changes are good

return err
}
err = cleanupCSPIResources(cspcGot)
return err
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

In the next PR's we can generate an event instead of returning an error. The event will be more visible to the user.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Will take this in next PR

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can you take care of this in same PR?

Copy link
Copy Markdown

@mittachaitu mittachaitu left a comment

Choose a reason for hiding this comment

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

changes are good

@shubham14bajpai shubham14bajpai changed the title fix(cspc): cleanup bdcs after deletion or scaledown of cspi WIP fix(cspc): cleanup bdcs after deletion or scaledown of cspi Jan 21, 2020
@shubham14bajpai shubham14bajpai changed the title WIP fix(cspc): cleanup bdcs after deletion or scaledown of cspi fix(cspc): cleanup bdcs after deletion or scaledown of cspi Jan 21, 2020
return nil
}
cspi.Finalizers = []string{}
cspi.Finalizers = util.RemoveString(cspi.Finalizers, apiscspc.PoolProtectionFinalizer)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

hope this works even if cspi.Finalizers doesn't have PoolProtectionFinalizer

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It works in both cases when the cspi.Finalizers slice is nil or the PoolProtectionFinalizer is not present in the slice. https://play.golang.org/p/kgnN2Xv_U4r

Signed-off-by: shubham <shubham.bajpai@mayadata.io>
Signed-off-by: shubham <shubham.bajpai@mayadata.io>
code for future predicates

Signed-off-by: shubham <shubham.bajpai@mayadata.io>
Signed-off-by: shubham <shubham.bajpai@mayadata.io>
Signed-off-by: shubham <shubham.bajpai@mayadata.io>
Signed-off-by: shubham <shubham.bajpai@mayadata.io>
Signed-off-by: shubham <shubham.bajpai@mayadata.io>
Signed-off-by: shubham <shubham.bajpai@mayadata.io>
Signed-off-by: shubham <shubham.bajpai@mayadata.io>
Signed-off-by: shubham <shubham.bajpai@mayadata.io>
Signed-off-by: shubham <shubham.bajpai@mayadata.io>
Copy link
Copy Markdown
Contributor

@vishnuitta vishnuitta left a comment

Choose a reason for hiding this comment

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

can we remove the 'ownerReferences' which are on these objects CSPI/BDC/CSPC

Signed-off-by: shubham <shubham.bajpai@mayadata.io>
Copy link
Copy Markdown
Contributor

@vishnuitta vishnuitta left a comment

Choose a reason for hiding this comment

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

changes are good

return nil
}
cspi.Finalizers = []string{}
cspi.Finalizers = util.RemoveString(cspi.Finalizers, apiscspc.PoolProtectionFinalizer)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caller code of removeFinalizer is making a CSPI update call(but there won't be any problem since we are not performing any operation after removing the finalizer).

if !util.ContainsString(cspi.Finalizers, apiscspc.PoolProtectionFinalizer) {
return nil
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@vishnuitta should we need to check any CVR's on this pool before triggering zpool.Destroy not in this PR may be in next PR. What will you suggest regarding CVR checking?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

we will take this in upcoming PRs.

Copy link
Copy Markdown
Contributor

@sonasingh46 sonasingh46 left a comment

Choose a reason for hiding this comment

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

lgtm

Signed-off-by: shubham <shubham.bajpai@mayadata.io>
@vishnuitta vishnuitta merged commit 49b17e8 into openebs-archive:master Jan 27, 2020
@shubham14bajpai shubham14bajpai deleted the bdc branch March 17, 2020 06:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants