mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-14 18:40:55 +00:00
Compare commits
9 Commits
api/v0.7.2
...
issue3377
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3d17503329 | ||
|
|
d28ce28130 | ||
|
|
4f72faeecb | ||
|
|
29814b556b | ||
|
|
d94ed369fa | ||
|
|
0cf18987d7 | ||
|
|
a6374db2cb | ||
|
|
e98eada736 | ||
|
|
8a65ece956 |
16
Makefile
16
Makefile
@@ -26,8 +26,8 @@ verify-kustomize: \
|
||||
lint-kustomize \
|
||||
test-unit-kustomize-all \
|
||||
test-examples-kustomize-against-HEAD \
|
||||
test-examples-kustomize-against-3.9.0 \
|
||||
test-examples-kustomize-against-3.8.8
|
||||
test-examples-kustomize-against-3.9.2 \
|
||||
test-examples-kustomize-against-3.8.9
|
||||
|
||||
# The following target referenced by a file in
|
||||
# https://github.com/kubernetes/test-infra/tree/master/config/jobs/kubernetes-sigs/kustomize
|
||||
@@ -39,8 +39,8 @@ prow-presubmit-check: \
|
||||
test-unit-cmd-all \
|
||||
test-go-mod \
|
||||
test-examples-kustomize-against-HEAD \
|
||||
test-examples-kustomize-against-3.9.0 \
|
||||
test-examples-kustomize-against-3.8.8
|
||||
test-examples-kustomize-against-3.9.2 \
|
||||
test-examples-kustomize-against-3.8.9
|
||||
|
||||
.PHONY: verify-kustomize-e2e
|
||||
verify-kustomize-e2e: test-examples-e2e-kustomize
|
||||
@@ -276,12 +276,12 @@ test-examples-kustomize-against-HEAD: $(MYGOBIN)/kustomize $(MYGOBIN)/mdrip
|
||||
./hack/testExamplesAgainstKustomize.sh HEAD
|
||||
|
||||
.PHONY:
|
||||
test-examples-kustomize-against-3.9.0: $(MYGOBIN)/mdrip
|
||||
./hack/testExamplesAgainstKustomize.sh v3.9.0
|
||||
test-examples-kustomize-against-3.9.2: $(MYGOBIN)/mdrip
|
||||
./hack/testExamplesAgainstKustomize.sh v3.9.2
|
||||
|
||||
.PHONY:
|
||||
test-examples-kustomize-against-3.8.8: $(MYGOBIN)/mdrip
|
||||
./hack/testExamplesAgainstKustomize.sh v3.8.8
|
||||
test-examples-kustomize-against-3.8.9: $(MYGOBIN)/mdrip
|
||||
./hack/testExamplesAgainstKustomize.sh v3.8.9
|
||||
|
||||
# linux only.
|
||||
# This is for testing an example plugin that
|
||||
|
||||
@@ -24,3 +24,5 @@ require (
|
||||
sigs.k8s.io/kustomize/kyaml v0.10.6
|
||||
sigs.k8s.io/yaml v1.2.0
|
||||
)
|
||||
|
||||
replace sigs.k8s.io/kustomize/kyaml => ../kyaml
|
||||
|
||||
@@ -599,8 +599,6 @@ mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b h1:DxJ5nJdkhDlLok9K6qO+5290kphD
|
||||
mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jCoyKnw3vv5biOc3JnIcYfL4=
|
||||
mvdan.cc/unparam v0.0.0-20190720180237-d51796306d8f h1:Cq7MalBHYACRd6EesksG1Q8EoIAKOsiZviGKbOLIej4=
|
||||
mvdan.cc/unparam v0.0.0-20190720180237-d51796306d8f/go.mod h1:4G1h5nDURzA3bwVMZIVpwbkw+04kSxk3rAtzlimaUJw=
|
||||
sigs.k8s.io/kustomize/kyaml v0.10.6 h1:xUJxc/k8JoWqHUahaB8DTqY0KwEPxTbTGStvW8TOcDc=
|
||||
sigs.k8s.io/kustomize/kyaml v0.10.6/go.mod h1:K9yg1k/HB/6xNOf5VH3LhTo1DK9/5ykSZO5uIv+Y/1k=
|
||||
sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI=
|
||||
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
|
||||
sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q=
|
||||
|
||||
283
api/krusty/issue3377_test.go
Normal file
283
api/krusty/issue3377_test.go
Normal file
@@ -0,0 +1,283 @@
|
||||
// Copyright 2021 The Kubernetes Authors.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package krusty_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
kusttest_test "sigs.k8s.io/kustomize/api/testutils/kusttest"
|
||||
)
|
||||
|
||||
func TestIssue3377(t *testing.T) {
|
||||
th := kusttest_test.MakeHarness(t)
|
||||
opts := th.MakeDefaultOptions()
|
||||
th.WriteK(".", `
|
||||
resources:
|
||||
- service-a.yaml
|
||||
- service-b.yaml
|
||||
|
||||
patchesJson6902:
|
||||
- path: service-a-patch.yaml
|
||||
target:
|
||||
version: v1
|
||||
group: networking.k8s.io
|
||||
kind: Ingress
|
||||
name: service-a
|
||||
- path: service-b-patch.yaml
|
||||
target:
|
||||
version: v1
|
||||
group: networking.k8s.io
|
||||
kind: Ingress
|
||||
name: service-b
|
||||
vars:
|
||||
- name: SERVICE_A_DNS_NAME
|
||||
objref:
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
name: service-a
|
||||
fieldref:
|
||||
fieldpath: spec.rules[0].host
|
||||
- name: SERVICE_B_DNS_NAME
|
||||
objref:
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
name: service-b
|
||||
fieldref:
|
||||
fieldpath: spec.rules[0].host
|
||||
`)
|
||||
|
||||
th.WriteF("service-a.yaml", `
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: service-a
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/component: service-a
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/component: service-a
|
||||
spec:
|
||||
containers:
|
||||
- image: repository/service-a:v1
|
||||
imagePullPolicy: Always
|
||||
name: service-b
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
env:
|
||||
- name: REDIRECT_URI
|
||||
value: "http://$(SERVICE_B_DNS_NAME):80/oauth_redir"
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: service-a
|
||||
labels:
|
||||
app.kubernetes.io/component: service-a
|
||||
spec:
|
||||
type: LoadBalancer
|
||||
ports:
|
||||
- port: 8080
|
||||
selector:
|
||||
app.kubernetes.io/component: service-a
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: service-a
|
||||
spec:
|
||||
rules:
|
||||
- host: service-a.k8s.com
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: service-a
|
||||
port:
|
||||
number: 8080
|
||||
`)
|
||||
|
||||
th.WriteF("service-a-patch.yaml", `
|
||||
- op: replace
|
||||
path: /spec/rules/0/host
|
||||
value: new-service-a.k8s.com
|
||||
`)
|
||||
|
||||
th.WriteF("service-b.yaml", `
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: service-b
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/component: service-b
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/component: service-b
|
||||
spec:
|
||||
containers:
|
||||
- image: repository/service-b:v1
|
||||
imagePullPolicy: Always
|
||||
name: service-b
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
env:
|
||||
- name: REDIRECT_URI
|
||||
value: "http://$(SERVICE_A_DNS_NAME):80/oauth_redir"
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: service-b
|
||||
labels:
|
||||
app.kubernetes.io/component: service-b
|
||||
spec:
|
||||
type: LoadBalancer
|
||||
ports:
|
||||
- port: 8080
|
||||
selector:
|
||||
app.kubernetes.io/component: service-b
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: service-b
|
||||
spec:
|
||||
rules:
|
||||
- host: service-b.k8s.com
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: service-b
|
||||
port:
|
||||
number: 8080
|
||||
`)
|
||||
th.WriteF("service-b-patch.yaml", `
|
||||
- op: replace
|
||||
path: /spec/rules/0/host
|
||||
value: new-service-b.k8s.com
|
||||
`)
|
||||
m := th.Run(".", opts)
|
||||
th.AssertActualEqualsExpected(
|
||||
m, `
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: service-a
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/component: service-a
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/component: service-a
|
||||
spec:
|
||||
containers:
|
||||
- env:
|
||||
- name: REDIRECT_URI
|
||||
value: http://new-service-b.k8s.com:80/oauth_redir
|
||||
image: repository/service-a:v1
|
||||
imagePullPolicy: Always
|
||||
name: service-b
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/component: service-a
|
||||
name: service-a
|
||||
spec:
|
||||
ports:
|
||||
- port: 8080
|
||||
selector:
|
||||
app.kubernetes.io/component: service-a
|
||||
type: LoadBalancer
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: service-a
|
||||
spec:
|
||||
rules:
|
||||
- host: new-service-a.k8s.com
|
||||
http:
|
||||
paths:
|
||||
- backend:
|
||||
service:
|
||||
name: service-a
|
||||
port:
|
||||
number: 8080
|
||||
path: /
|
||||
pathType: Prefix
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: service-b
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/component: service-b
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/component: service-b
|
||||
spec:
|
||||
containers:
|
||||
- env:
|
||||
- name: REDIRECT_URI
|
||||
value: http://new-service-a.k8s.com:80/oauth_redir
|
||||
image: repository/service-b:v1
|
||||
imagePullPolicy: Always
|
||||
name: service-b
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/component: service-b
|
||||
name: service-b
|
||||
spec:
|
||||
ports:
|
||||
- port: 8080
|
||||
selector:
|
||||
app.kubernetes.io/component: service-b
|
||||
type: LoadBalancer
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: service-b
|
||||
spec:
|
||||
rules:
|
||||
- host: new-service-b.k8s.com
|
||||
http:
|
||||
paths:
|
||||
- backend:
|
||||
service:
|
||||
name: service-b
|
||||
port:
|
||||
number: 8080
|
||||
path: /
|
||||
pathType: Prefix
|
||||
`)
|
||||
}
|
||||
@@ -17,3 +17,5 @@ require (
|
||||
k8s.io/apimachinery v0.18.10
|
||||
sigs.k8s.io/kustomize/kyaml v0.10.6
|
||||
)
|
||||
|
||||
replace sigs.k8s.io/kustomize/kyaml => ../../kyaml
|
||||
|
||||
@@ -388,8 +388,6 @@ k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUc
|
||||
k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8=
|
||||
k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I=
|
||||
k8s.io/kube-openapi v0.0.0-20200410145947-61e04a5be9a6/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E=
|
||||
sigs.k8s.io/kustomize/kyaml v0.10.6 h1:xUJxc/k8JoWqHUahaB8DTqY0KwEPxTbTGStvW8TOcDc=
|
||||
sigs.k8s.io/kustomize/kyaml v0.10.6/go.mod h1:K9yg1k/HB/6xNOf5VH3LhTo1DK9/5ykSZO5uIv+Y/1k=
|
||||
sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw=
|
||||
sigs.k8s.io/structured-merge-diff/v3 v3.0.0/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw=
|
||||
sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs=
|
||||
|
||||
@@ -6,9 +6,11 @@ require (
|
||||
github.com/rakyll/statik v0.1.7
|
||||
github.com/spf13/cobra v1.0.0
|
||||
github.com/stretchr/testify v1.4.0
|
||||
sigs.k8s.io/kustomize/api v0.7.1
|
||||
sigs.k8s.io/kustomize/api v0.7.2
|
||||
sigs.k8s.io/kustomize/kyaml v0.10.6
|
||||
sigs.k8s.io/yaml v1.2.0
|
||||
)
|
||||
|
||||
replace sigs.k8s.io/kustomize/api => ../../api
|
||||
|
||||
replace sigs.k8s.io/kustomize/kyaml => ../../kyaml
|
||||
|
||||
@@ -534,8 +534,6 @@ k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl
|
||||
mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc=
|
||||
mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jCoyKnw3vv5biOc3JnIcYfL4=
|
||||
mvdan.cc/unparam v0.0.0-20190720180237-d51796306d8f/go.mod h1:4G1h5nDURzA3bwVMZIVpwbkw+04kSxk3rAtzlimaUJw=
|
||||
sigs.k8s.io/kustomize/kyaml v0.10.6 h1:xUJxc/k8JoWqHUahaB8DTqY0KwEPxTbTGStvW8TOcDc=
|
||||
sigs.k8s.io/kustomize/kyaml v0.10.6/go.mod h1:K9yg1k/HB/6xNOf5VH3LhTo1DK9/5ykSZO5uIv+Y/1k=
|
||||
sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI=
|
||||
sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs=
|
||||
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
|
||||
|
||||
@@ -8,7 +8,7 @@ require (
|
||||
github.com/spf13/cobra v1.0.0
|
||||
github.com/spf13/pflag v1.0.5
|
||||
k8s.io/client-go v0.18.10
|
||||
sigs.k8s.io/kustomize/api v0.7.1
|
||||
sigs.k8s.io/kustomize/api v0.7.2
|
||||
sigs.k8s.io/kustomize/cmd/config v0.8.8
|
||||
sigs.k8s.io/kustomize/kyaml v0.10.6
|
||||
sigs.k8s.io/yaml v1.2.0
|
||||
@@ -21,3 +21,7 @@ exclude (
|
||||
)
|
||||
|
||||
replace sigs.k8s.io/kustomize/api => ../api
|
||||
|
||||
replace sigs.k8s.io/kustomize/cmd/config => ../cmd/config
|
||||
|
||||
replace sigs.k8s.io/kustomize/kyaml => ../kyaml
|
||||
|
||||
@@ -622,10 +622,6 @@ k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89/go.mod h1:sZAwmy6armz5eXlNoLmJcl
|
||||
mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc=
|
||||
mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jCoyKnw3vv5biOc3JnIcYfL4=
|
||||
mvdan.cc/unparam v0.0.0-20190720180237-d51796306d8f/go.mod h1:4G1h5nDURzA3bwVMZIVpwbkw+04kSxk3rAtzlimaUJw=
|
||||
sigs.k8s.io/kustomize/cmd/config v0.8.8 h1:B0ecq4yYrD1zcigW7E9xOtv40D/87vokzlNzhkROxKM=
|
||||
sigs.k8s.io/kustomize/cmd/config v0.8.8/go.mod h1:SUgpGFAeXIIJua6SIGsMgXpNCx5eiMbl7wNlm57KXt4=
|
||||
sigs.k8s.io/kustomize/kyaml v0.10.6 h1:xUJxc/k8JoWqHUahaB8DTqY0KwEPxTbTGStvW8TOcDc=
|
||||
sigs.k8s.io/kustomize/kyaml v0.10.6/go.mod h1:K9yg1k/HB/6xNOf5VH3LhTo1DK9/5ykSZO5uIv+Y/1k=
|
||||
sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e h1:4Z09Hglb792X0kfOBBJUPFEyvVfQWrYT/l8h5EKA6JQ=
|
||||
sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI=
|
||||
sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw=
|
||||
|
||||
@@ -3,10 +3,10 @@ module sigs.k8s.io/kustomize/plugin/builtin/annotationstransformer
|
||||
go 1.15
|
||||
|
||||
require (
|
||||
sigs.k8s.io/kustomize/api v0.7.1
|
||||
sigs.k8s.io/kustomize/api v0.7.2
|
||||
sigs.k8s.io/yaml v1.2.0
|
||||
)
|
||||
|
||||
replace sigs.k8s.io/kustomize/api => ../../../api
|
||||
|
||||
replace sigs.k8s.io/kustomize/kyaml => ../../../kyaml
|
||||
|
||||
replace sigs.k8s.io/kustomize/api => ../../../api
|
||||
|
||||
@@ -3,7 +3,7 @@ module sigs.k8s.io/kustomize/plugin/builtin/configmapgenerator
|
||||
go 1.15
|
||||
|
||||
require (
|
||||
sigs.k8s.io/kustomize/api v0.7.1
|
||||
sigs.k8s.io/kustomize/api v0.7.2
|
||||
sigs.k8s.io/yaml v1.2.0
|
||||
)
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ module sigs.k8s.io/kustomize/plugin/builtin/hashtransformer
|
||||
|
||||
go 1.15
|
||||
|
||||
require sigs.k8s.io/kustomize/api v0.7.1
|
||||
require sigs.k8s.io/kustomize/api v0.7.2
|
||||
|
||||
replace sigs.k8s.io/kustomize/kyaml => ../../../kyaml
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ go 1.15
|
||||
require (
|
||||
github.com/imdario/mergo v0.3.5
|
||||
github.com/pkg/errors v0.8.1
|
||||
sigs.k8s.io/kustomize/api v0.7.1
|
||||
sigs.k8s.io/kustomize/api v0.7.2
|
||||
sigs.k8s.io/yaml v1.2.0
|
||||
)
|
||||
|
||||
|
||||
@@ -3,10 +3,10 @@ module sigs.k8s.io/kustomize/plugin/builtin/imagetagtransformer
|
||||
go 1.15
|
||||
|
||||
require (
|
||||
sigs.k8s.io/kustomize/api v0.7.1
|
||||
sigs.k8s.io/kustomize/api v0.7.2
|
||||
sigs.k8s.io/yaml v1.2.0
|
||||
)
|
||||
|
||||
replace sigs.k8s.io/kustomize/api => ../../../api
|
||||
|
||||
replace sigs.k8s.io/kustomize/kyaml => ../../../kyaml
|
||||
|
||||
replace sigs.k8s.io/kustomize/api => ../../../api
|
||||
|
||||
@@ -3,10 +3,10 @@ module sigs.k8s.io/kustomize/plugin/builtin/labeltransformer
|
||||
go 1.15
|
||||
|
||||
require (
|
||||
sigs.k8s.io/kustomize/api v0.7.1
|
||||
sigs.k8s.io/kustomize/api v0.7.2
|
||||
sigs.k8s.io/yaml v1.2.0
|
||||
)
|
||||
|
||||
replace sigs.k8s.io/kustomize/api => ../../../api
|
||||
|
||||
replace sigs.k8s.io/kustomize/kyaml => ../../../kyaml
|
||||
|
||||
replace sigs.k8s.io/kustomize/api => ../../../api
|
||||
|
||||
@@ -4,7 +4,7 @@ go 1.15
|
||||
|
||||
require (
|
||||
github.com/pkg/errors v0.8.1
|
||||
sigs.k8s.io/kustomize/api v0.7.1
|
||||
sigs.k8s.io/kustomize/api v0.7.2
|
||||
)
|
||||
|
||||
replace sigs.k8s.io/kustomize/kyaml => ../../../kyaml
|
||||
|
||||
@@ -3,10 +3,10 @@ module sigs.k8s.io/kustomize/plugin/builtin/namespacetransformer
|
||||
go 1.15
|
||||
|
||||
require (
|
||||
sigs.k8s.io/kustomize/api v0.7.1
|
||||
sigs.k8s.io/kustomize/api v0.7.2
|
||||
sigs.k8s.io/yaml v1.2.0
|
||||
)
|
||||
|
||||
replace sigs.k8s.io/kustomize/api => ../../../api
|
||||
|
||||
replace sigs.k8s.io/kustomize/kyaml => ../../../kyaml
|
||||
|
||||
replace sigs.k8s.io/kustomize/api => ../../../api
|
||||
|
||||
@@ -5,10 +5,10 @@ go 1.15
|
||||
require (
|
||||
github.com/evanphx/json-patch v4.5.0+incompatible
|
||||
github.com/pkg/errors v0.8.1
|
||||
sigs.k8s.io/kustomize/api v0.7.1
|
||||
sigs.k8s.io/kustomize/api v0.7.2
|
||||
sigs.k8s.io/yaml v1.2.0
|
||||
)
|
||||
|
||||
replace sigs.k8s.io/kustomize/api => ../../../api
|
||||
|
||||
replace sigs.k8s.io/kustomize/kyaml => ../../../kyaml
|
||||
|
||||
replace sigs.k8s.io/kustomize/api => ../../../api
|
||||
|
||||
@@ -4,7 +4,7 @@ go 1.15
|
||||
|
||||
require (
|
||||
github.com/stretchr/testify v1.4.0
|
||||
sigs.k8s.io/kustomize/api v0.7.1
|
||||
sigs.k8s.io/kustomize/api v0.7.2
|
||||
sigs.k8s.io/yaml v1.2.0
|
||||
)
|
||||
|
||||
|
||||
@@ -4,10 +4,10 @@ go 1.15
|
||||
|
||||
require (
|
||||
github.com/evanphx/json-patch v4.5.0+incompatible
|
||||
sigs.k8s.io/kustomize/api v0.7.1
|
||||
sigs.k8s.io/kustomize/api v0.7.2
|
||||
sigs.k8s.io/yaml v1.2.0
|
||||
)
|
||||
|
||||
replace sigs.k8s.io/kustomize/api => ../../../api
|
||||
|
||||
replace sigs.k8s.io/kustomize/kyaml => ../../../kyaml
|
||||
|
||||
replace sigs.k8s.io/kustomize/api => ../../../api
|
||||
|
||||
@@ -3,10 +3,10 @@ module sigs.k8s.io/kustomize/plugin/builtin/prefixsuffixtransformer
|
||||
go 1.15
|
||||
|
||||
require (
|
||||
sigs.k8s.io/kustomize/api v0.7.1
|
||||
sigs.k8s.io/kustomize/api v0.7.2
|
||||
sigs.k8s.io/yaml v1.2.0
|
||||
)
|
||||
|
||||
replace sigs.k8s.io/kustomize/api => ../../../api
|
||||
|
||||
replace sigs.k8s.io/kustomize/kyaml => ../../../kyaml
|
||||
|
||||
replace sigs.k8s.io/kustomize/api => ../../../api
|
||||
|
||||
@@ -3,10 +3,10 @@ module sigs.k8s.io/kustomize/plugin/builtin/replicacounttransformer
|
||||
go 1.15
|
||||
|
||||
require (
|
||||
sigs.k8s.io/kustomize/api v0.7.1
|
||||
sigs.k8s.io/kustomize/api v0.7.2
|
||||
sigs.k8s.io/yaml v1.2.0
|
||||
)
|
||||
|
||||
replace sigs.k8s.io/kustomize/api => ../../../api
|
||||
|
||||
replace sigs.k8s.io/kustomize/kyaml => ../../../kyaml
|
||||
|
||||
replace sigs.k8s.io/kustomize/api => ../../../api
|
||||
|
||||
@@ -3,7 +3,7 @@ module sigs.k8s.io/kustomize/plugin/builtin/secretgenerator
|
||||
go 1.15
|
||||
|
||||
require (
|
||||
sigs.k8s.io/kustomize/api v0.7.1
|
||||
sigs.k8s.io/kustomize/api v0.7.2
|
||||
sigs.k8s.io/yaml v1.2.0
|
||||
)
|
||||
|
||||
|
||||
@@ -3,10 +3,10 @@ module sigs.k8s.io/kustomize/plugin/builtin/valueaddtransformer
|
||||
go 1.15
|
||||
|
||||
require (
|
||||
sigs.k8s.io/kustomize/api v0.7.1
|
||||
sigs.k8s.io/kustomize/api v0.7.2
|
||||
sigs.k8s.io/yaml v1.2.0
|
||||
)
|
||||
|
||||
replace sigs.k8s.io/kustomize/api => ../../../api
|
||||
|
||||
replace sigs.k8s.io/kustomize/kyaml => ../../../kyaml
|
||||
|
||||
replace sigs.k8s.io/kustomize/api => ../../../api
|
||||
|
||||
@@ -2,7 +2,7 @@ module sigs.k8s.io/kustomize/plugin/someteam.example.com/v1/bashedconfigmap
|
||||
|
||||
go 1.15
|
||||
|
||||
require sigs.k8s.io/kustomize/api v0.7.1
|
||||
require sigs.k8s.io/kustomize/api v0.7.2
|
||||
|
||||
replace sigs.k8s.io/kustomize/kyaml => ../../../../kyaml
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ module sigs.k8s.io/kustomize/plugin/someteam.example.com/v1/calvinduplicator
|
||||
go 1.15
|
||||
|
||||
require (
|
||||
sigs.k8s.io/kustomize/api v0.7.1
|
||||
sigs.k8s.io/kustomize/api v0.7.2
|
||||
sigs.k8s.io/yaml v1.2.0
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ go 1.15
|
||||
|
||||
require (
|
||||
github.com/pkg/errors v0.8.1
|
||||
sigs.k8s.io/kustomize/api v0.7.1
|
||||
sigs.k8s.io/kustomize/api v0.7.2
|
||||
sigs.k8s.io/yaml v1.2.0
|
||||
)
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ module sigs.k8s.io/kustomize/plugin/someteam.example.com/v1/printpluginenv
|
||||
|
||||
go 1.15
|
||||
|
||||
require sigs.k8s.io/kustomize/api v0.7.1
|
||||
require sigs.k8s.io/kustomize/api v0.7.2
|
||||
|
||||
replace sigs.k8s.io/kustomize/kyaml => ../../../../kyaml
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ module sigs.k8s.io/kustomize/plugin/someteam.example.com/v1/secretsfromdatabase
|
||||
go 1.15
|
||||
|
||||
require (
|
||||
sigs.k8s.io/kustomize/api v0.7.1
|
||||
sigs.k8s.io/kustomize/api v0.7.2
|
||||
sigs.k8s.io/yaml v1.2.0
|
||||
)
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ module sigs.k8s.io/kustomize/plugin/someteam.example.com/v1/sedtransformer
|
||||
|
||||
go 1.15
|
||||
|
||||
require sigs.k8s.io/kustomize/api v0.7.1
|
||||
require sigs.k8s.io/kustomize/api v0.7.2
|
||||
|
||||
replace sigs.k8s.io/kustomize/kyaml => ../../../../kyaml
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ module sigs.k8s.io/kustomize/plugin/someteam.example.com/v1/someservicegenerator
|
||||
go 1.15
|
||||
|
||||
require (
|
||||
sigs.k8s.io/kustomize/api v0.7.1
|
||||
sigs.k8s.io/kustomize/api v0.7.2
|
||||
sigs.k8s.io/yaml v1.2.0
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ go 1.15
|
||||
|
||||
require (
|
||||
github.com/pkg/errors v0.8.1
|
||||
sigs.k8s.io/kustomize/api v0.7.1
|
||||
sigs.k8s.io/kustomize/api v0.7.2
|
||||
sigs.k8s.io/yaml v1.2.0
|
||||
)
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ module sigs.k8s.io/kustomize/plugin/someteam.example.com/v1/validator
|
||||
|
||||
go 1.15
|
||||
|
||||
require sigs.k8s.io/kustomize/api v0.7.1
|
||||
require sigs.k8s.io/kustomize/api v0.7.2
|
||||
|
||||
replace sigs.k8s.io/kustomize/kyaml => ../../../../kyaml
|
||||
|
||||
|
||||
@@ -2,6 +2,6 @@ module sigs.k8s.io/kustomize/plugin/untested/v1/gogetter
|
||||
|
||||
go 1.15
|
||||
|
||||
require sigs.k8s.io/kustomize/api v0.7.1
|
||||
require sigs.k8s.io/kustomize/api v0.7.2
|
||||
|
||||
replace sigs.k8s.io/kustomize/api => ../../../../api
|
||||
|
||||
@@ -3,7 +3,7 @@ module sigs.k8s.io/kustomize/plugin/untested/v1/replacementtransformer
|
||||
go 1.15
|
||||
|
||||
require (
|
||||
sigs.k8s.io/kustomize/api v0.7.1
|
||||
sigs.k8s.io/kustomize/api v0.7.2
|
||||
sigs.k8s.io/yaml v1.2.0
|
||||
)
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ The dependencies determine the release order:
|
||||
Thus, do `kyaml` first, then `cli-utils`, etc.
|
||||
|
||||
#### Consider fetching new OpenAPI data
|
||||
The Kubernetes OpenAPI data changes no more frequently than once per quarter.
|
||||
The Kubernetes OpenAPI data changes no more frequently than once per quarter.
|
||||
You can check the current builtin versions that kustomize is using with the
|
||||
following command.
|
||||
```
|
||||
@@ -40,22 +40,67 @@ kustomize openapi info
|
||||
Instructions on how to get a new OpenAPI sample can be found in the
|
||||
[OpenAPI Readme].
|
||||
|
||||
#### Establish clean state
|
||||
#### Make some helper functions
|
||||
|
||||
```
|
||||
cd ~/gopath/src/sigs.k8s.io/kustomize
|
||||
git fetch upstream
|
||||
git co master
|
||||
git rebase upstream/master
|
||||
function createBranch {
|
||||
branch=$1
|
||||
echo "Making branch $branch : \"$title\""
|
||||
git branch -D $branch # delete if it exists
|
||||
git co -b $branch
|
||||
git commit -a -m "$title"
|
||||
git push -f origin $branch
|
||||
}
|
||||
```
|
||||
|
||||
make prow-presubmit-check >& /tmp/k.txt; echo $?
|
||||
# The exit code should be zero; if not examine /tmp/k.txt
|
||||
```
|
||||
function createPr {
|
||||
gh pr create --title "$title" --body "ALLOW_MODULE_SPAN" --base master
|
||||
}
|
||||
```
|
||||
|
||||
```
|
||||
function refreshMaster {
|
||||
git co master
|
||||
git fetch upstream
|
||||
git rebase upstream/master
|
||||
}
|
||||
```
|
||||
|
||||
```
|
||||
function testKustomizeRepo {
|
||||
make prow-presubmit-check >& /tmp/k.txt
|
||||
local code=$?
|
||||
if [ $code -ne 0 ]; then
|
||||
echo "**** FAILURE ******************"
|
||||
tail -n /tmp/k.txt
|
||||
else
|
||||
echo "LGTM"
|
||||
fi
|
||||
}
|
||||
```
|
||||
|
||||
#### Install the release tool
|
||||
|
||||
```
|
||||
(cd cmd/gorepomod; go install .)
|
||||
( cd cmd/gorepomod; go install . )
|
||||
```
|
||||
|
||||
#### Authenticate to github using [gh](https://github.com/cli/cli)
|
||||
|
||||
```
|
||||
# Use your own token
|
||||
GITHUB_TOKEN=deadbeefdeadbeef
|
||||
|
||||
echo $GITHUB_TOKEN | gh auth login --scopes repo --with-token
|
||||
```
|
||||
|
||||
#### Establish clean state
|
||||
|
||||
```
|
||||
cd ~/gopath/src/sigs.k8s.io/kustomize
|
||||
refreshMaster
|
||||
testKustomizeRepo
|
||||
```
|
||||
|
||||
#### Release `kyaml`
|
||||
@@ -63,97 +108,276 @@ make prow-presubmit-check >& /tmp/k.txt; echo $?
|
||||
```
|
||||
gorepomod release kyaml --doIt
|
||||
```
|
||||
Undraft the release on the [kustomize repo release page].
|
||||
|
||||
Note the version:
|
||||
```
|
||||
versionKyaml=v0.10.6 # EDIT THIS!
|
||||
```
|
||||
|
||||
Undraft the release on the [kustomize repo release page],
|
||||
make sure the version number is what you expect.
|
||||
|
||||
|
||||
#### Release [`cli-utils`](https://github.com/kubernetes-sigs/cli-utils)
|
||||
|
||||
|
||||
```
|
||||
cd ../cli-utils
|
||||
```
|
||||
|
||||
# Determine which version of kyaml you want at
|
||||
# https://github.com/kubernetes-sigs/kustomize/releases
|
||||
#
|
||||
# Pin ./go.mod to that version, e.g.:
|
||||
go mod edit -require sigs.k8s.io/kustomize/kyaml@v0.9.1
|
||||
Pin to the new version of kyaml you just released:
|
||||
```
|
||||
go mod edit -require sigs.k8s.io/kustomize/kyaml@$versionKyaml
|
||||
```
|
||||
|
||||
# Test it
|
||||
Test it
|
||||
```
|
||||
make test
|
||||
make test-e2e
|
||||
```
|
||||
|
||||
# Merge these changes to upstream (make a PR, merge it)
|
||||
Create the PR
|
||||
```
|
||||
title="Pin cli-utils to kyaml $versionKyaml"
|
||||
createBranch pinKyaml
|
||||
createPr
|
||||
```
|
||||
|
||||
git fetch upstream
|
||||
git co master
|
||||
git rebase upstream/master
|
||||
Run local tests while GH runs tests in the cloud:
|
||||
```
|
||||
testKustomizeRepo
|
||||
```
|
||||
|
||||
# Release cli-utils
|
||||
Wait for tests to pass, then merge the PR:
|
||||
```
|
||||
gh pr status
|
||||
gh pr merge -m
|
||||
```
|
||||
|
||||
Get back on master and do paranoia test:
|
||||
```
|
||||
refreshMaster
|
||||
testKustomizeRepo
|
||||
```
|
||||
|
||||
Release it:
|
||||
```
|
||||
gorepomod release {top} --doIt
|
||||
```
|
||||
|
||||
Note the version:
|
||||
```
|
||||
versionCliUtils=v0.22.4 # EDIT THIS!
|
||||
```
|
||||
|
||||
#### Release `cmd/config`
|
||||
|
||||
```
|
||||
cd ../kustomize
|
||||
```
|
||||
|
||||
# Pin to the most recent kyaml.
|
||||
Pin to the most recent kyaml.
|
||||
|
||||
```
|
||||
gorepomod pin kyaml --doIt
|
||||
```
|
||||
|
||||
# Determine which version of cli-utils you want at
|
||||
# https://github.com/kubernetes-sigs/cli-utils/releases
|
||||
#
|
||||
# Pin cmd/config/go.mod to that version, e.g.:
|
||||
(cd cmd/config; go mod edit -require=sigs.k8s.io/cli-utils@v0.20.4)
|
||||
Pin to the version of cli-utils you just created
|
||||
([releases](https://github.com/kubernetes-sigs/cli-utils/releases))
|
||||
|
||||
# Test it.
|
||||
make prow-presubmit-check >& /tmp/k.txt; echo $?
|
||||
```
|
||||
(cd cmd/config; \
|
||||
go mod edit -require=sigs.k8s.io/cli-utils@$versionCliUtils)
|
||||
```
|
||||
|
||||
# Make a PR and merge these changes.
|
||||
Test it.
|
||||
|
||||
# Release it.
|
||||
```
|
||||
testKustomizeRepo
|
||||
```
|
||||
|
||||
Create the PR:
|
||||
```
|
||||
title="Pin to kyaml $versionKyaml and cli-utils $versionCliUtils"
|
||||
createBranch pinToKyamlAndCliUtils
|
||||
createPr
|
||||
```
|
||||
|
||||
Run local tests while GH runs tests in the cloud:
|
||||
```
|
||||
testKustomizeRepo
|
||||
```
|
||||
|
||||
Wait for tests to pass, then merge the PR:
|
||||
```
|
||||
gh pr status
|
||||
gh pr merge -m
|
||||
```
|
||||
|
||||
Get back on master and do paranoia test:
|
||||
```
|
||||
refreshMaster
|
||||
testKustomizeRepo
|
||||
```
|
||||
|
||||
Release it:
|
||||
```
|
||||
gorepomod release cmd/config --doIt
|
||||
```
|
||||
|
||||
Undraft the release on the [kustomize repo release page].
|
||||
Note the version:
|
||||
```
|
||||
versionCmdConfig=v0.8.8 # EDIT THIS!
|
||||
```
|
||||
|
||||
Undraft the release on the [kustomize repo release page],
|
||||
make sure the version number is what you expect.
|
||||
|
||||
|
||||
#### Release `api` (the kustomize API, used by the CLI)
|
||||
|
||||
|
||||
Pin to the new cmd/config:
|
||||
|
||||
```
|
||||
gorepomod pin cmd/config --doIt
|
||||
# Merge these changes.
|
||||
```
|
||||
|
||||
Create the PR:
|
||||
```
|
||||
title="Pin to cmd/config $versionCmdConfig"
|
||||
createBranch pinToCmdConfig
|
||||
createPr
|
||||
```
|
||||
|
||||
Run local tests while GH runs tests in the cloud:
|
||||
```
|
||||
testKustomizeRepo
|
||||
```
|
||||
|
||||
Wait for tests to pass, then merge the PR:
|
||||
```
|
||||
gh pr status # rinse, repeat
|
||||
gh pr merge -m
|
||||
```
|
||||
|
||||
Get back on master and do paranoia test:
|
||||
```
|
||||
refreshMaster
|
||||
testKustomizeRepo
|
||||
```
|
||||
|
||||
Release it:
|
||||
```
|
||||
gorepomod release api --doIt
|
||||
```
|
||||
|
||||
Undraft the release on the [kustomize repo release page].
|
||||
Note the version:
|
||||
```
|
||||
versionApi=v0.7.2 # EDIT THIS!
|
||||
```
|
||||
|
||||
Undraft the release on the [kustomize repo release page],
|
||||
make sure the version number is what you expect.
|
||||
|
||||
|
||||
#### Release the kustomize CLI
|
||||
|
||||
Pin to the new API:
|
||||
```
|
||||
gorepomod pin api --doIt
|
||||
# Merge these changes.
|
||||
```
|
||||
|
||||
gorepomod release kustomize --doIt
|
||||
Create the PR:
|
||||
```
|
||||
title="Pin to api $versionApi"
|
||||
createBranch pinToApi
|
||||
createPr
|
||||
```
|
||||
|
||||
Run local tests while GH runs tests in the cloud:
|
||||
```
|
||||
testKustomizeRepo
|
||||
```
|
||||
|
||||
Wait for tests to pass, then merge the PR:
|
||||
```
|
||||
gh pr status # rinse, repeat
|
||||
gh pr merge -m
|
||||
```
|
||||
|
||||
Get back on master and do paranoia test:
|
||||
```
|
||||
refreshMaster
|
||||
testKustomizeRepo
|
||||
```
|
||||
|
||||
Release it:
|
||||
```
|
||||
gorepomod release kustomize --doIt
|
||||
```
|
||||
|
||||
Undraft the release on the [kustomize repo release page].
|
||||
|
||||
### Important
|
||||
|
||||
[installation instructions]: https://kubectl.docs.kubernetes.io/installation/kustomize/binaries/
|
||||
|
||||
* Follow the [installation instructions] to install your new
|
||||
releas and make sure it reports the expected version number.
|
||||
|
||||
If not, something is very wrong.
|
||||
|
||||
* Visit the [release page] and edit the release notes as desired.
|
||||
|
||||
|
||||
#### Unpin everything
|
||||
|
||||
Go back into development mode, so current code in-repo
|
||||
depends on current code in-repo.
|
||||
|
||||
Go back into development mode, where all modules depend on in-repo code:
|
||||
|
||||
```
|
||||
gorepomod unpin api --doIt
|
||||
gorepomod unpin api --doIt
|
||||
gorepomod unpin cmd/config --doIt
|
||||
gorepomod unpin kyaml --doIt
|
||||
# Merge these changes.
|
||||
gorepomod unpin kyaml --doIt
|
||||
```
|
||||
|
||||
Visit the [release page] and edit the release notes as desired;
|
||||
this should be automated, and descriptions in PR's should
|
||||
be standardized to make automation possible.
|
||||
See kubebuilder project.
|
||||
Create the PR:
|
||||
```
|
||||
title="Back to development mode; unpin the modules"
|
||||
createBranch unpinEverything
|
||||
createPr
|
||||
```
|
||||
|
||||
Run local tests while GH runs tests in the cloud:
|
||||
```
|
||||
testKustomizeRepo
|
||||
```
|
||||
|
||||
Wait for tests to pass, then merge the PR:
|
||||
```
|
||||
gh pr status # rinse, repeat
|
||||
gh pr merge -m
|
||||
```
|
||||
|
||||
Get back on master and do paranoia test:
|
||||
```
|
||||
refreshMaster
|
||||
testKustomizeRepo
|
||||
```
|
||||
|
||||
### Finally
|
||||
|
||||
[Makefile]: https://github.com/kubernetes-sigs/kustomize/blob/master/Makefile
|
||||
|
||||
Edit the `prow-presubmit-target` in the [Makefile]
|
||||
to test examples against your new release.
|
||||
|
||||
----
|
||||
|
||||
----
|
||||
|
||||
Older notes follow:
|
||||
|
||||
## Public Modules
|
||||
|
||||
|
||||
Reference in New Issue
Block a user