-
Notifications
You must be signed in to change notification settings - Fork 8.1k
fixed issue #35591, remove Istio operator CR with specified revision … #35720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…if it is uninstalled
|
$ istioctl install --set profile=demo -y $ istioctl x uninstall --revision canary |
|
/test integ-security-k8s-tests_istio |
| return nil | ||
| } | ||
|
|
||
| // getIstioOperatorCRDName get the Istio operator crd name based on specified revision |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: s/getIstioOperatorCRDName/getIstioOperatorCRName/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@morvencao okay, done!
operator/pkg/helmreconciler/prune.go
Outdated
| } else { | ||
| // Remove Istio operator CR with specified revision if it is uninstalled | ||
| ioplist := h.getIstioOperatorCR() | ||
| if ioplist.Items != nil { | ||
| for _, iop := range ioplist.Items { | ||
| revisionIop := getIstioOperatorCRDName(revision) | ||
| if iop.GetName() == revisionIop { | ||
| if iopToList, err := iop.ToList(); err == nil { | ||
| iopToList.Items = []unstructured.Unstructured{iop} | ||
| usList = append(usList, iopToList) | ||
| break | ||
| } | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if it's proper to add getting IOP CR logic here, GetPrunedResources is used to get resources for specified component, for IOP instance with multiple enabled components, the IOP CR will be added to usList multiple times.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @morvencao, thanks for your comment, I have checked that there are only 2 places to call GetPrunedResources: one is uninstall and the other one is to get resources for specified component for some enabled components. I only need to handle the former, so I added an assertion for this. Thanks again!
|
🤔 🐛 You appear to be fixing a bug in Go code, yet your PR doesn't include updates to any test files. Did you forget to add a test? Courtesy of your friendly test nag. |
|
/test integ-pilot-multicluster-tests_istio |
fixed issue #35591, remove Istio operator CR with specified revision if it is uninstalled
To help us figure out who should review this PR, please put an X in all the areas that this PR affects.
Please check any characteristics that apply to this pull request.