Skip to content
This repository has been archived by the owner on Mar 24, 2023. It is now read-only.

Commit

Permalink
Merge pull request #829 from laverya/use-kustomize-head
Browse files Browse the repository at this point in the history
Use kustomize head, allowing the use of other list types
  • Loading branch information
laverya authored Feb 15, 2019
2 parents 54a8a3a + 9bbc02c commit b9fc82c
Show file tree
Hide file tree
Showing 23 changed files with 245 additions and 40 deletions.
6 changes: 3 additions & 3 deletions Gopkg.lock

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

2 changes: 1 addition & 1 deletion Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ ignored = [

[[constraint]]
name = "sigs.k8s.io/kustomize"
version = "2.0.1"
branch = "master"

[[override]]
name = "k8s.io/kubernetes"
Expand Down
8 changes: 8 additions & 0 deletions integration/init/other-list-types/expected/.ship/state.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"v1": {
"config": {},
"releaseName": "ship",
"upstream": "https://github.com/replicatedhq/test-charts/tree/0e13bc2c19778b67f83f68c5e2886de0cd43d59f/other-list-types",
"contentSHA": "78ca09c481a6c8b2d507da0c171defab38aa33dc990b4034b5447d75f74b7fdf"
}
}
11 changes: 11 additions & 0 deletions integration/init/other-list-types/expected/base/configmapList.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: ConfigMapList
items:
- apiVersion: v1
kind: ConfigMap
metadata:
name: winnie
- apiVersion: v1
kind: ConfigMap
metadata:
name: notwinnie
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: ""
apiversion: ""
resources:
- configmapList.yaml
- roleBindingList.yaml
- roleList.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBindingList
items:
- apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: rolebinding-prometheus
labels:
app: default-prometheus
namespace: default
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: role-prometheus
subjects:
- kind: ServiceAccount
name: role-prometheus
namespace: default
22 changes: 22 additions & 0 deletions integration/init/other-list-types/expected/base/roleList.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleList
items:
- apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: role-prometheus
labels:
app: default-prometheus
namespace: default
rules:
- apiGroups:
- ""
resources:
- nodes
- services
- endpoints
- pods
verbs:
- get
- list
- watch
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
kind: ""
apiversion: ""
bases:
- ../../base
45 changes: 45 additions & 0 deletions integration/init/other-list-types/expected/rendered.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
labels:
app: default-prometheus
name: role-prometheus
namespace: default
rules:
- apiGroups:
- ""
resources:
- nodes
- services
- endpoints
- pods
verbs:
- get
- list
- watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
labels:
app: default-prometheus
name: rolebinding-prometheus
namespace: default
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: role-prometheus
subjects:
- kind: ServiceAccount
name: role-prometheus
namespace: default
---
apiVersion: v1
kind: ConfigMap
metadata:
name: notwinnie
---
apiVersion: v1
kind: ConfigMap
metadata:
name: winnie
3 changes: 3 additions & 0 deletions integration/init/other-list-types/metadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
upstream: "https://github.com/replicatedhq/test-charts/tree/0e13bc2c19778b67f83f68c5e2886de0cd43d59f/other-list-types"
args: ["--prefer-git"]
skip_cleanup: false
2 changes: 1 addition & 1 deletion pkg/patch/kustomize.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (p *ShipPatcher) runKustomize(out io.Writer, fSys fs.FileSystem, kustomizat

k8sFactory := k8sdeps.NewFactory()

kt, err := target.NewKustTarget(ldr, fSys, k8sFactory.ResmapF, k8sFactory.TransformerF)
kt, err := target.NewKustTarget(ldr, k8sFactory.ResmapF, k8sFactory.TransformerF)
if err != nil {
return errors.Wrap(err, "make customized kustomize target")
}
Expand Down

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

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

2 changes: 1 addition & 1 deletion vendor/sigs.k8s.io/kustomize/k8sdeps/kunstruct/factory.go

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

9 changes: 8 additions & 1 deletion vendor/sigs.k8s.io/kustomize/pkg/git/repospec.go

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

7 changes: 6 additions & 1 deletion vendor/sigs.k8s.io/kustomize/pkg/resource/factory.go

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

2 changes: 1 addition & 1 deletion vendor/sigs.k8s.io/kustomize/pkg/resource/resource.go

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

33 changes: 21 additions & 12 deletions vendor/sigs.k8s.io/kustomize/pkg/target/kusttarget.go

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

5 changes: 5 additions & 0 deletions vendor/sigs.k8s.io/kustomize/pkg/target/resaccumulator.go

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

Loading

0 comments on commit b9fc82c

Please sign in to comment.