Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Commit 4d0fd12

Browse files
committed
fix test
1 parent 9c6e100 commit 4d0fd12

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

pkg/name/name.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ var (
103103
KialiComponentName: ThirdPartyFeatureName,
104104
TracingComponentName: ThirdPartyFeatureName,
105105
}
106-
// TODO: merge this with the componentMaps defined in translateConfig
107106
// ComponentNameToHelmComponentPath defines mapping from component name to helm component root path.
108-
ComponentNameToHelmComponentPath = map[ComponentName]string {
107+
// TODO: merge this with the componentMaps defined in translateConfig
108+
ComponentNameToHelmComponentPath = map[ComponentName]string{
109109
PilotComponentName: "pilot",
110110
GalleyComponentName: "galley",
111111
SidecarInjectorComponentName: "sidecarInjectorWebhook",
@@ -156,9 +156,15 @@ func IsFeatureEnabledInSpec(featureName FeatureName, controlPlaneSpec *v1alpha2.
156156
// IsComponentEnabledInSpec assumes that controlPlaneSpec has been validated.
157157
// TODO: remove extra validations when comfort level is high enough.
158158
func IsComponentEnabledInSpec(featureName FeatureName, componentName ComponentName, controlPlaneSpec *v1alpha2.IstioControlPlaneSpec) (bool, error) {
159-
// if component enablement path is defined and found in Values part, return it first, otherwise check from ISCP.
159+
// for third Party components, enablement is only defined in values part.
160+
if featureName == ThirdPartyFeatureName {
161+
enabled, _, err := IsComponentEnabledFromValue(string(componentName), controlPlaneSpec.Values)
162+
return enabled, err
163+
}
164+
// for Istio components, check whether override path exist in values part first then ISCP.
160165
valuePath := ComponentNameToHelmComponentPath[componentName]
161166
enabled, pathExist, err := IsComponentEnabledFromValue(valuePath, controlPlaneSpec.Values)
167+
// only return value when path exists
162168
if err == nil && pathExist {
163169
return enabled, nil
164170
}
@@ -212,7 +218,7 @@ func IsComponentEnabledFromValue(valuePath string, valueSpec map[string]interfac
212218
return false, false, err
213219
}
214220
if found {
215-
return true, true, nil
221+
return true, false, nil
216222
}
217223
return false, false, nil
218224
}

0 commit comments

Comments
 (0)