You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@uniffle.apache.org by "advancedxy (via GitHub)" <gi...@apache.org> on 2023/02/01 03:56:56 UTC

[GitHub] [incubator-uniffle] advancedxy commented on a diff in pull request #531: [ISSUE-524][operator] Upgrading rss could also be deleted

advancedxy commented on code in PR #531:
URL: https://github.com/apache/incubator-uniffle/pull/531#discussion_r1092740065


##########
deploy/kubernetes/operator/pkg/webhook/inspector/rss.go:
##########
@@ -35,19 +35,19 @@ import (
 // validateRSS validates the create and update operation towards rss objects.
 func (i *inspector) validateRSS(ar *admissionv1.AdmissionReview) *admissionv1.AdmissionReview {
 	if !i.ignoreRSS && ar.Request.Operation == admissionv1.Update {
-		oldRSS := &unifflev1alpha1.RemoteShuffleService{}
+		oldRSS := &uniffleAPI.RemoteShuffleService{}
 		if err := json.Unmarshal(ar.Request.OldObject.Raw, oldRSS); err != nil {
 			klog.Errorf("unmarshal old object of rss (%v) failed: %v",
 				string(ar.Request.OldObject.Raw), err)
 			return util.AdmissionReviewFailed(ar, err)
 		}
-		// for security purposes, we forbid updating rss objects when they are in upgrading phase.
-		if oldRSS.Status.Phase == unifflev1alpha1.RSSUpgrading {
-			message := "can not update upgrading rss object: " + utils.UniqueName(oldRSS)
+		// for security purposes, we forbid updating rss objects when they are in upgrading/terminating phase.
+		if oldRSS.Status.Phase == uniffleAPI.RSSUpgrading || oldRSS.Status.Phase == uniffleAPI.RSSTerminating {

Review Comment:
   Let me confirm one thing first, when controller updates rss' upgrading to terminating, is that update request also validated by this code path?
   
   In my local test, this line was kept intact, I only changed controller/rss.go:L357, and found upgrading rss object could be deleted normally.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org