Skip to content

Commit

Permalink
Fix enablement path for CNI (istio#522)
Browse files Browse the repository at this point in the history
* Fix enablement path for CNI

* Fix tests
  • Loading branch information
ostromart authored and istio-testing committed Nov 5, 2019
1 parent 388e0a0 commit 32c592d
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 21 deletions.
2 changes: 1 addition & 1 deletion cmd/mesh/testdata/manifest-generate/output/all_on.yaml

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions cmd/mesh/testdata/profile-dump/output/all_off.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ autoInjection:
maxUnavailable: 25%
enabled: false
cni:
components:
cni:
enabled: false
enabled: false
configManagement:
components:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ autoInjection:
maxUnavailable: 25%
enabled: true
cni:
components:
cni:
enabled: false
enabled: false
configManagement:
components:
Expand Down
3 changes: 0 additions & 3 deletions cmd/mesh/testdata/profile-dump/output/sds_policy_off.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ autoInjection:
maxUnavailable: 25%
enabled: true
cni:
components:
cni:
enabled: false
enabled: false
configManagement:
components:
Expand Down
3 changes: 0 additions & 3 deletions data/profiles/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,6 @@ spec:
# Istio CNI feature
cni:
enabled: false
components:
cni:
enabled: false

# Global values passed through to helm global.yaml.
values:
Expand Down
8 changes: 7 additions & 1 deletion pkg/translate/translate.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,13 @@ func (t *Translator) setEnablementAndNamespaces(root map[string]interface{}, icp
if err != nil {
return err
}
if err := tpath.WriteNode(root, util.PathFromString(c.ToHelmValuesTreeRoot+"."+HelmValuesEnabledSubpath), e); err != nil {

enablementPath := c.ToHelmValuesTreeRoot
// CNI calls itself "cni" in the chart but "istio_cni" for enablement outside of the chart.
if cn == name.CNIComponentName {
enablementPath = "istio_cni"
}
if err := tpath.WriteNode(root, util.PathFromString(enablementPath+"."+HelmValuesEnabledSubpath), e); err != nil {
return err
}

Expand Down
6 changes: 4 additions & 2 deletions pkg/translate/translate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ defaultNamespace: istio-system
enabled: false
namespace: istio-system
cni:
enabled: false
namespace: istio-system
galley:
enabled: false
Expand All @@ -64,6 +63,8 @@ global:
grafana:
enabled: false
namespace: istio-system
istio_cni:
enabled: false
kiali:
enabled: false
namespace: istio-system
Expand Down Expand Up @@ -106,7 +107,6 @@ defaultNamespace: istio-system
enabled: false
namespace: istio-system
cni:
enabled: false
namespace: istio-system
galley:
enabled: false
Expand All @@ -132,6 +132,8 @@ global:
grafana:
enabled: false
namespace: istio-system
istio_cni:
enabled: false
kiali:
enabled: false
namespace: istio-system
Expand Down
3 changes: 0 additions & 3 deletions pkg/vfs/assets.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 32c592d

Please sign in to comment.