Skip to content
This repository has been archived by the owner on Dec 7, 2022. It is now read-only.

Commit

Permalink
Fix plugin enable field not effective error
Browse files Browse the repository at this point in the history
  • Loading branch information
cywang1905 authored and YonkaFang committed Mar 18, 2022
1 parent 609ba70 commit 781d37c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions controllers/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ func (r *EnvoyPluginReconciler) translateEnvoyPlugin(cr *microserviceslimeiov1al

for _, t := range targets {
for _, p := range in.Plugins {
if !p.Enable {
continue
}

if p.PluginSettings == nil {
log.Errorf("empty setting, cause error happend, skip plugin build, plugin: %s", p.Name)
continue
Expand Down Expand Up @@ -189,8 +193,10 @@ func (r *PluginManagerReconciler) translatePluginManager(in *v1alpha1.PluginMana
Labels: in.WorkloadLabels,
}
out.ConfigPatches = make([]*istio.EnvoyFilter_EnvoyConfigObjectPatch, 0)
for i := range in.Plugin {
p := in.Plugin[len(in.Plugin)-i-1]
for _, p := range in.Plugin {
if !p.Enable {
continue
}
patch, err := r.convertPluginToPatch(p)
if err != nil {
log.Errorf("cause error happened, skip plugin build, plugin: %s, %+v", p.Name, err)
Expand Down

0 comments on commit 781d37c

Please sign in to comment.