Skip to content

Commit

Permalink
sync v0.6 to master head (#213)
Browse files Browse the repository at this point in the history
* Copy istio to its own package (#205)

* move istio to its own package

* put back gcp/istio*

* make ClusterRbacConfig configurable (#209)

* remove istio from gcp (#212)
  • Loading branch information
kunmingg authored and k8s-ci-robot committed Jul 16, 2019
1 parent 2a0a78c commit 5ce477e
Show file tree
Hide file tree
Showing 13 changed files with 55 additions and 16 deletions.
5 changes: 0 additions & 5 deletions gcp/istio/base/kustomization.yaml

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,4 @@ kind: ClusterRbacConfig
metadata:
name: default
spec:
mode: "ON"
mode: $(clusterRbacConfig)
18 changes: 18 additions & 0 deletions istio/istio/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- kf-istio-resources.yaml
namespace: kubeflow
configMapGenerator:
- name: istio-parameters
env: params.env
vars:
- name: clusterRbacConfig
objref:
kind: ConfigMap
name: istio-parameters
apiVersion: v1
fieldref:
fieldpath: data.clusterRbacConfig
configurations:
- params.yaml
1 change: 1 addition & 0 deletions istio/istio/base/params.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
clusterRbacConfig=ON
3 changes: 3 additions & 0 deletions istio/istio/base/params.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
varReference:
- path: spec/mode
kind: ClusterRbacConfig
31 changes: 26 additions & 5 deletions tests/istio-base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
)

func writeIstioBase(th *KustTestHarness) {
th.writeF("/manifests/gcp/istio/base/kf-istio-resources.yaml", `
th.writeF("/manifests/istio/istio/base/kf-istio-resources.yaml", `
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
Expand Down Expand Up @@ -122,25 +122,46 @@ kind: ClusterRbacConfig
metadata:
name: default
spec:
mode: "ON"
mode: $(clusterRbacConfig)
`)
th.writeK("/manifests/gcp/istio/base", `
th.writeF("/manifests/istio/istio/base/params.env", `
clusterRbacConfig=ON
`)
th.writeF("/manifests/istio/istio/base/params.yaml", `
varReference:
- path: spec/mode
kind: ClusterRbacConfig
`)
th.writeK("/manifests/istio/istio/base", `
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- kf-istio-resources.yaml
namespace: kubeflow
configMapGenerator:
- name: istio-parameters
env: params.env
vars:
- name: clusterRbacConfig
objref:
kind: ConfigMap
name: istio-parameters
apiVersion: v1
fieldref:
fieldpath: data.clusterRbacConfig
configurations:
- params.yaml
`)
}

func TestIstioBase(t *testing.T) {
th := NewKustTestHarness(t, "/manifests/gcp/istio/base")
th := NewKustTestHarness(t, "/manifests/istio/istio/base")
writeIstioBase(th)
m, err := th.makeKustTarget().MakeCustomizedResMap()
if err != nil {
t.Fatalf("Err: %v", err)
}
targetPath := "../gcp/istio/base"
targetPath := "../istio/istio/base"
fsys := fs.MakeRealFS()
_loader, loaderErr := loader.NewLoader(targetPath, fsys)
if loaderErr != nil {
Expand Down
8 changes: 4 additions & 4 deletions tests/istio-crds-base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
)

func writeIstioCrdsBase(th *KustTestHarness) {
th.writeF("/manifests/gcp/istio-crds/base/crds.yaml", `
th.writeF("/manifests/istio/istio-crds/base/crds.yaml", `
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -1549,7 +1549,7 @@ spec:
plural: challenges
scope: Namespaced
`)
th.writeK("/manifests/gcp/istio-crds/base", `
th.writeK("/manifests/istio/istio-crds/base", `
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
Expand All @@ -1559,13 +1559,13 @@ namespace: kubeflow
}

func TestIstioCrdsBase(t *testing.T) {
th := NewKustTestHarness(t, "/manifests/gcp/istio-crds/base")
th := NewKustTestHarness(t, "/manifests/istio/istio-crds/base")
writeIstioCrdsBase(th)
m, err := th.makeKustTarget().MakeCustomizedResMap()
if err != nil {
t.Fatalf("Err: %v", err)
}
targetPath := "../gcp/istio-crds/base"
targetPath := "../istio/istio-crds/base"
fsys := fs.MakeRealFS()
_loader, loaderErr := loader.NewLoader(targetPath, fsys)
if loaderErr != nil {
Expand Down
3 changes: 2 additions & 1 deletion tests/prometheus-base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,8 @@ varReference:
th.writeF("/manifests/gcp/prometheus/base/params.env", `
projectId=
clusterName=
zone=`)
zone=
`)
th.writeK("/manifests/gcp/prometheus/base", `
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
Expand Down

0 comments on commit 5ce477e

Please sign in to comment.