mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-29 17:41:13 +00:00
Compare commits
156 Commits
release-cm
...
api/v0.5.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
def00220ce | ||
|
|
d3a7335bbc | ||
|
|
42d1f7b792 | ||
|
|
8912c454ff | ||
|
|
d4eb2c9426 | ||
|
|
d2b95fb09a | ||
|
|
298b3c8622 | ||
|
|
c12e95fe06 | ||
|
|
87c7a32ffe | ||
|
|
a7545bdad3 | ||
|
|
622a121042 | ||
|
|
c7bc9d2066 | ||
|
|
9567d7ef16 | ||
|
|
e5b0ceb4e3 | ||
|
|
5fb238a581 | ||
|
|
3ddc9af6c5 | ||
|
|
128e171c20 | ||
|
|
c2681b6fae | ||
|
|
ae5c392319 | ||
|
|
66bcf84682 | ||
|
|
436dada184 | ||
|
|
a689e0c2b4 | ||
|
|
30ae7183a4 | ||
|
|
279a9b673f | ||
|
|
0ac45c65c9 | ||
|
|
d7fb813c16 | ||
|
|
83c5c4d1f1 | ||
|
|
7259d3eb48 | ||
|
|
0e44202c20 | ||
|
|
0d90b769f1 | ||
|
|
7ad2791072 | ||
|
|
6de94548ba | ||
|
|
b1b190227e | ||
|
|
4ceddaa8f4 | ||
|
|
9e64ac5315 | ||
|
|
f24ec14956 | ||
|
|
98a92a6443 | ||
|
|
8bb612889c | ||
|
|
e3ec184e92 | ||
|
|
3019230283 | ||
|
|
69adcf9aaf | ||
|
|
8d543d8483 | ||
|
|
94a55210e1 | ||
|
|
441581b745 | ||
|
|
a066ba9628 | ||
|
|
3a0dd72c88 | ||
|
|
d4ed285fd1 | ||
|
|
4cae8cfe9b | ||
|
|
b044a52a84 | ||
|
|
5607478d8e | ||
|
|
d60cf8ebc5 | ||
|
|
ef04983392 | ||
|
|
2153863355 | ||
|
|
4afab168c5 | ||
|
|
2c52e3a851 | ||
|
|
781e396122 | ||
|
|
cebb1b31ab | ||
|
|
9137d2a39a | ||
|
|
95f4ecd261 | ||
|
|
600d4f2c0b | ||
|
|
6c4c5cf9ad | ||
|
|
5f5b23af58 | ||
|
|
ae5a690146 | ||
|
|
625e011e2b | ||
|
|
01ce33b926 | ||
|
|
a323d78bbc | ||
|
|
69dc34500a | ||
|
|
919bdb84c9 | ||
|
|
178f4e21f0 | ||
|
|
d732a6faab | ||
|
|
f053ca6a5f | ||
|
|
dfc5c32af5 | ||
|
|
80b3f4e00a | ||
|
|
4646bca230 | ||
|
|
57ca8fa321 | ||
|
|
de7fa4bf3a | ||
|
|
af1280ea43 | ||
|
|
0dd191c0f6 | ||
|
|
e20e126d65 | ||
|
|
abf862fff1 | ||
|
|
27cf3981ca | ||
|
|
2c39ff0fa0 | ||
|
|
afc14afe45 | ||
|
|
6e91e0667d | ||
|
|
1aca8b8b9e | ||
|
|
448c060084 | ||
|
|
b3951942e3 | ||
|
|
b78464c8b1 | ||
|
|
9bd4f78288 | ||
|
|
85e9fa94b0 | ||
|
|
c754927112 | ||
|
|
8049c57b72 | ||
|
|
695ec44bf7 | ||
|
|
5b394b2079 | ||
|
|
97c2ac77cd | ||
|
|
3183fcc926 | ||
|
|
0af9ca1266 | ||
|
|
a6111b5c3c | ||
|
|
fdbd1bdbbb | ||
|
|
16baf7a955 | ||
|
|
69aea07c4e | ||
|
|
2250ad3e18 | ||
|
|
c107d1ddff | ||
|
|
f17b893dd2 | ||
|
|
09894d3022 | ||
|
|
fd3e84f701 | ||
|
|
22d5d4d2c1 | ||
|
|
145ba0c7ff | ||
|
|
a83433d5cf | ||
|
|
2d496e0efe | ||
|
|
171412cc98 | ||
|
|
68ab3b87d9 | ||
|
|
e9bd11caaa | ||
|
|
a895220743 | ||
|
|
ab2dc7fcb9 | ||
|
|
afde29601a | ||
|
|
be0f1a7fcb | ||
|
|
99d2994b98 | ||
|
|
94101fb7cc | ||
|
|
346071897e | ||
|
|
0772540214 | ||
|
|
6791688f5f | ||
|
|
28307bc435 | ||
|
|
29cadfe8b0 | ||
|
|
68f4f330f5 | ||
|
|
507779c9dc | ||
|
|
062d0f7b75 | ||
|
|
e783af2881 | ||
|
|
f2da1f621f | ||
|
|
294312f2fc | ||
|
|
ff79bd0b31 | ||
|
|
410e300243 | ||
|
|
e994b3b566 | ||
|
|
b39c522cc1 | ||
|
|
dc4bf03da2 | ||
|
|
a158eeaaff | ||
|
|
4cd3944860 | ||
|
|
79a48a8802 | ||
|
|
5a33e90f18 | ||
|
|
e77d1a881f | ||
|
|
343b938c73 | ||
|
|
25186e94af | ||
|
|
e4ba898e20 | ||
|
|
22a6017870 | ||
|
|
e62f1adabf | ||
|
|
7e2d3ff5ab | ||
|
|
fb6830c98a | ||
|
|
52e8a701ac | ||
|
|
160485ef19 | ||
|
|
cea1154cd9 | ||
|
|
4843718a2b | ||
|
|
a0c1979798 | ||
|
|
8576acf1aa | ||
|
|
1e7a764900 | ||
|
|
af7df1448d | ||
|
|
518147c129 |
8
Makefile
8
Makefile
@@ -15,7 +15,7 @@ verify-kustomize: \
|
|||||||
lint-kustomize \
|
lint-kustomize \
|
||||||
test-unit-kustomize-all \
|
test-unit-kustomize-all \
|
||||||
test-examples-kustomize-against-HEAD \
|
test-examples-kustomize-against-HEAD \
|
||||||
test-examples-kustomize-against-3.6.1
|
test-examples-kustomize-against-3.7.0
|
||||||
|
|
||||||
# The following target referenced by a file in
|
# The following target referenced by a file in
|
||||||
# https://github.com/kubernetes/test-infra/tree/master/config/jobs/kubernetes-sigs/kustomize
|
# https://github.com/kubernetes/test-infra/tree/master/config/jobs/kubernetes-sigs/kustomize
|
||||||
@@ -24,7 +24,7 @@ prow-presubmit-check: \
|
|||||||
lint-kustomize \
|
lint-kustomize \
|
||||||
test-unit-kustomize-all \
|
test-unit-kustomize-all \
|
||||||
test-examples-kustomize-against-HEAD \
|
test-examples-kustomize-against-HEAD \
|
||||||
test-examples-kustomize-against-3.6.1 \
|
test-examples-kustomize-against-3.7.0 \
|
||||||
test-unit-cmd-all \
|
test-unit-cmd-all \
|
||||||
test-go-mod
|
test-go-mod
|
||||||
|
|
||||||
@@ -233,10 +233,10 @@ test-examples-kustomize-against-HEAD: $(MYGOBIN)/kustomize $(MYGOBIN)/mdrip
|
|||||||
./hack/testExamplesAgainstKustomize.sh HEAD
|
./hack/testExamplesAgainstKustomize.sh HEAD
|
||||||
|
|
||||||
.PHONY:
|
.PHONY:
|
||||||
test-examples-kustomize-against-3.6.1: $(MYGOBIN)/mdrip
|
test-examples-kustomize-against-3.7.0: $(MYGOBIN)/mdrip
|
||||||
( \
|
( \
|
||||||
set -e; \
|
set -e; \
|
||||||
tag=v3.6.1; \
|
tag=v3.7.0; \
|
||||||
/bin/rm -f $(MYGOBIN)/kustomize; \
|
/bin/rm -f $(MYGOBIN)/kustomize; \
|
||||||
echo "Installing kustomize $$tag."; \
|
echo "Installing kustomize $$tag."; \
|
||||||
GO111MODULE=on go get sigs.k8s.io/kustomize/kustomize/v3@$${tag}; \
|
GO111MODULE=on go get sigs.k8s.io/kustomize/kustomize/v3@$${tag}; \
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ func (p *AnnotationsTransformerPlugin) Transform(m resmap.ResMap) error {
|
|||||||
err := filtersutil.ApplyToJSON(annotations.Filter{
|
err := filtersutil.ApplyToJSON(annotations.Filter{
|
||||||
Annotations: p.Annotations,
|
Annotations: p.Annotations,
|
||||||
FsSlice: p.FieldSpecs,
|
FsSlice: p.FieldSpecs,
|
||||||
}, r.Kunstructured)
|
}, r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ func (p *LabelTransformerPlugin) Transform(m resmap.ResMap) error {
|
|||||||
err := filtersutil.ApplyToJSON(labels.Filter{
|
err := filtersutil.ApplyToJSON(labels.Filter{
|
||||||
Labels: p.Labels,
|
Labels: p.Labels,
|
||||||
FsSlice: p.FieldSpecs,
|
FsSlice: p.FieldSpecs,
|
||||||
}, r.Kunstructured)
|
}, r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ package builtins
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"sigs.k8s.io/kustomize/api/filters/namespace"
|
"sigs.k8s.io/kustomize/api/filters/namespace"
|
||||||
"sigs.k8s.io/kustomize/api/resid"
|
"sigs.k8s.io/kustomize/api/resid"
|
||||||
@@ -31,6 +32,11 @@ func (p *NamespaceTransformerPlugin) Config(
|
|||||||
_ *resmap.PluginHelpers, c []byte) (err error) {
|
_ *resmap.PluginHelpers, c []byte) (err error) {
|
||||||
p.Namespace = ""
|
p.Namespace = ""
|
||||||
p.FieldSpecs = nil
|
p.FieldSpecs = nil
|
||||||
|
if !strings.Contains(string(c), "yamlSupport") {
|
||||||
|
// If not explicitly denied,
|
||||||
|
// activate kyaml-based transformation.
|
||||||
|
p.YAMLSupport = true
|
||||||
|
}
|
||||||
return yaml.Unmarshal(c, p)
|
return yaml.Unmarshal(c, p)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -51,7 +57,7 @@ func (p *NamespaceTransformerPlugin) Transform(m resmap.ResMap) error {
|
|||||||
err := filtersutil.ApplyToJSON(namespace.Filter{
|
err := filtersutil.ApplyToJSON(namespace.Filter{
|
||||||
Namespace: p.Namespace,
|
Namespace: p.Namespace,
|
||||||
FsSlice: p.FieldSpecs,
|
FsSlice: p.FieldSpecs,
|
||||||
}, r.Kunstructured)
|
}, r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ package builtins
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"strings"
|
||||||
|
|
||||||
jsonpatch "github.com/evanphx/json-patch"
|
jsonpatch "github.com/evanphx/json-patch"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
@@ -34,6 +35,11 @@ func (p *PatchJson6902TransformerPlugin) Config(
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if !strings.Contains(string(c), "yamlSupport") {
|
||||||
|
// If not explicitly denied,
|
||||||
|
// activate kyaml-based transformation.
|
||||||
|
p.YAMLSupport = true
|
||||||
|
}
|
||||||
if p.Target.Name == "" {
|
if p.Target.Name == "" {
|
||||||
return fmt.Errorf("must specify the target name")
|
return fmt.Errorf("must specify the target name")
|
||||||
}
|
}
|
||||||
@@ -101,7 +107,7 @@ func (p *PatchJson6902TransformerPlugin) Transform(m resmap.ResMap) error {
|
|||||||
} else {
|
} else {
|
||||||
return filtersutil.ApplyToJSON(patchjson6902.Filter{
|
return filtersutil.ApplyToJSON(patchjson6902.Filter{
|
||||||
Patch: p.JsonOp,
|
Patch: p.JsonOp,
|
||||||
}, obj.Kunstructured)
|
}, obj)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,10 +4,8 @@
|
|||||||
package builtins
|
package builtins
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"strings"
|
||||||
kyaml "sigs.k8s.io/kustomize/kyaml/yaml"
|
|
||||||
|
|
||||||
"sigs.k8s.io/kustomize/api/filters/patchstrategicmerge"
|
"sigs.k8s.io/kustomize/api/filters/patchstrategicmerge"
|
||||||
"sigs.k8s.io/kustomize/api/resmap"
|
"sigs.k8s.io/kustomize/api/resmap"
|
||||||
@@ -33,6 +31,11 @@ func (p *PatchStrategicMergeTransformerPlugin) Config(
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if !strings.Contains(string(c), "yamlSupport") {
|
||||||
|
// If not explicitly denied,
|
||||||
|
// activate kyaml-based transformation.
|
||||||
|
p.YAMLSupport = true
|
||||||
|
}
|
||||||
if len(p.Paths) == 0 && p.Patches == "" {
|
if len(p.Paths) == 0 && p.Patches == "" {
|
||||||
return fmt.Errorf("empty file path and empty patch content")
|
return fmt.Errorf("empty file path and empty patch content")
|
||||||
}
|
}
|
||||||
@@ -77,41 +80,37 @@ func (p *PatchStrategicMergeTransformerPlugin) Transform(m resmap.ResMap) error
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if !p.YAMLSupport {
|
if !p.YAMLSupport {
|
||||||
err = target.Patch(patch.Kunstructured)
|
err = target.Patch(patch.Copy())
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
// remove the resource from resmap
|
|
||||||
// when the patch is to $patch: delete that target
|
|
||||||
if len(target.Map()) == 0 {
|
|
||||||
err = m.Remove(target.CurId())
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
node, err := getRNode(patch)
|
patchCopy := patch.DeepCopy()
|
||||||
|
patchCopy.SetName(target.GetName())
|
||||||
|
patchCopy.SetNamespace(target.GetNamespace())
|
||||||
|
patchCopy.SetGvk(target.GetGvk())
|
||||||
|
node, err := filtersutil.GetRNode(patchCopy)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
err = filtersutil.ApplyToJSON(patchstrategicmerge.Filter{
|
err = filtersutil.ApplyToJSON(patchstrategicmerge.Filter{
|
||||||
Patch: node,
|
Patch: node,
|
||||||
}, target.Kunstructured)
|
}, target)
|
||||||
|
}
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if len(target.Map()) == 0 {
|
||||||
|
// This means all fields have been removed from the object.
|
||||||
|
// This can happen if a patch required deletion of the
|
||||||
|
// entire resource (not just a part of it). This means
|
||||||
|
// the overall resmap must shrink by one.
|
||||||
|
err = m.Remove(target.CurId())
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: Remove this once the next version of kyaml is released which
|
|
||||||
// exposes GetRNode from the filutersutil package.
|
|
||||||
func getRNode(k json.Marshaler) (*kyaml.RNode, error) {
|
|
||||||
j, err := k.MarshalJSON()
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return kyaml.Parse(string(j))
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewPatchStrategicMergeTransformerPlugin() resmap.TransformerPlugin {
|
func NewPatchStrategicMergeTransformerPlugin() resmap.TransformerPlugin {
|
||||||
return &PatchStrategicMergeTransformerPlugin{}
|
return &PatchStrategicMergeTransformerPlugin{}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,6 +34,11 @@ func (p *PatchTransformerPlugin) Config(
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if !strings.Contains(string(c), "yamlSupport") {
|
||||||
|
// If not explicitly denied,
|
||||||
|
// activate kyaml-based transformation.
|
||||||
|
p.YAMLSupport = true
|
||||||
|
}
|
||||||
p.Patch = strings.TrimSpace(p.Patch)
|
p.Patch = strings.TrimSpace(p.Patch)
|
||||||
if p.Patch == "" && p.Path == "" {
|
if p.Patch == "" && p.Path == "" {
|
||||||
return fmt.Errorf(
|
return fmt.Errorf(
|
||||||
@@ -115,7 +120,7 @@ func (p *PatchTransformerPlugin) transformStrategicMerge(m resmap.ResMap, patch
|
|||||||
// use the legacy implementation or the kyaml-based solution.
|
// use the legacy implementation or the kyaml-based solution.
|
||||||
func (p *PatchTransformerPlugin) applySMPatch(resource, patch *resource.Resource) error {
|
func (p *PatchTransformerPlugin) applySMPatch(resource, patch *resource.Resource) error {
|
||||||
if !p.YAMLSupport {
|
if !p.YAMLSupport {
|
||||||
return resource.Patch(patch.Kunstructured)
|
return resource.Patch(patch.Copy())
|
||||||
} else {
|
} else {
|
||||||
node, err := filtersutil.GetRNode(patch)
|
node, err := filtersutil.GetRNode(patch)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -123,7 +128,7 @@ func (p *PatchTransformerPlugin) applySMPatch(resource, patch *resource.Resource
|
|||||||
}
|
}
|
||||||
return filtersutil.ApplyToJSON(patchstrategicmerge.Filter{
|
return filtersutil.ApplyToJSON(patchstrategicmerge.Filter{
|
||||||
Patch: node,
|
Patch: node,
|
||||||
}, resource.Kunstructured)
|
}, resource)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -165,7 +170,7 @@ func (p *PatchTransformerPlugin) applyJson6902Patch(resource *resource.Resource,
|
|||||||
} else {
|
} else {
|
||||||
return filtersutil.ApplyToJSON(patchjson6902.Filter{
|
return filtersutil.ApplyToJSON(patchjson6902.Filter{
|
||||||
Patch: p.Patch,
|
Patch: p.Patch,
|
||||||
}, resource.Kunstructured)
|
}, resource)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -121,13 +121,13 @@ func (p *ValueAddTransformerPlugin) Transform(m resmap.ResMap) (err error) {
|
|||||||
if t.FieldPath == types.MetadataNamespacePath {
|
if t.FieldPath == types.MetadataNamespacePath {
|
||||||
err = filtersutil.ApplyToJSON(namespace.Filter{
|
err = filtersutil.ApplyToJSON(namespace.Filter{
|
||||||
Namespace: p.Value,
|
Namespace: p.Value,
|
||||||
}, res.Kunstructured)
|
}, res)
|
||||||
} else {
|
} else {
|
||||||
err = filtersutil.ApplyToJSON(valueadd.Filter{
|
err = filtersutil.ApplyToJSON(valueadd.Filter{
|
||||||
Value: p.Value,
|
Value: p.Value,
|
||||||
FieldPath: t.FieldPath,
|
FieldPath: t.FieldPath,
|
||||||
FilePathPosition: t.FilePathPosition,
|
FilePathPosition: t.FilePathPosition,
|
||||||
}, res.Kunstructured)
|
}, res)
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// Copyright 2019 The Kubernetes Authors.
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
package patchstrategicmerge
|
package patchstrategicmerge
|
||||||
|
|
||||||
import (
|
import (
|
||||||
@@ -13,9 +16,13 @@ type Filter struct {
|
|||||||
var _ kio.Filter = Filter{}
|
var _ kio.Filter = Filter{}
|
||||||
|
|
||||||
func (pf Filter) Filter(nodes []*yaml.RNode) ([]*yaml.RNode, error) {
|
func (pf Filter) Filter(nodes []*yaml.RNode) ([]*yaml.RNode, error) {
|
||||||
return kio.FilterAll(yaml.FilterFunc(pf.run)).Filter(nodes)
|
var result []*yaml.RNode
|
||||||
}
|
for i := range nodes {
|
||||||
|
r, err := merge2.Merge(pf.Patch, nodes[i])
|
||||||
func (pf Filter) run(node *yaml.RNode) (*yaml.RNode, error) {
|
if err != nil {
|
||||||
return merge2.Merge(pf.Patch, node)
|
return nil, err
|
||||||
|
}
|
||||||
|
result = append(result, r)
|
||||||
|
}
|
||||||
|
return result, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,6 +31,86 @@ apiVersion: apps/v1
|
|||||||
metadata:
|
metadata:
|
||||||
name: yourDeploy
|
name: yourDeploy
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
"container patch": {
|
||||||
|
input: `
|
||||||
|
apiVersion: apps/v1
|
||||||
|
metadata:
|
||||||
|
name: myDeploy
|
||||||
|
kind: Deployment
|
||||||
|
spec:
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: foo1
|
||||||
|
- name: foo2
|
||||||
|
- name: foo3
|
||||||
|
`,
|
||||||
|
patch: yaml.MustParse(`
|
||||||
|
apiVersion: apps/v1
|
||||||
|
metadata:
|
||||||
|
name: myDeploy
|
||||||
|
kind: Deployment
|
||||||
|
spec:
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: foo0
|
||||||
|
`),
|
||||||
|
expected: `
|
||||||
|
apiVersion: apps/v1
|
||||||
|
metadata:
|
||||||
|
name: myDeploy
|
||||||
|
kind: Deployment
|
||||||
|
spec:
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: foo1
|
||||||
|
- name: foo2
|
||||||
|
- name: foo3
|
||||||
|
- name: foo0
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
"volumes patch": {
|
||||||
|
input: `
|
||||||
|
apiVersion: apps/v1
|
||||||
|
metadata:
|
||||||
|
name: myDeploy
|
||||||
|
kind: Deployment
|
||||||
|
spec:
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
volumes:
|
||||||
|
- name: foo1
|
||||||
|
- name: foo2
|
||||||
|
- name: foo3
|
||||||
|
`,
|
||||||
|
patch: yaml.MustParse(`
|
||||||
|
apiVersion: apps/v1
|
||||||
|
metadata:
|
||||||
|
name: myDeploy
|
||||||
|
kind: Deployment
|
||||||
|
spec:
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
volumes:
|
||||||
|
- name: foo0
|
||||||
|
`),
|
||||||
|
expected: `
|
||||||
|
apiVersion: apps/v1
|
||||||
|
metadata:
|
||||||
|
name: myDeploy
|
||||||
|
kind: Deployment
|
||||||
|
spec:
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
volumes:
|
||||||
|
- name: foo1
|
||||||
|
- name: foo2
|
||||||
|
- name: foo3
|
||||||
|
- name: foo0
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
"nested patch": {
|
"nested patch": {
|
||||||
|
|||||||
@@ -11,11 +11,11 @@ require (
|
|||||||
github.com/stretchr/testify v1.4.0
|
github.com/stretchr/testify v1.4.0
|
||||||
github.com/yujunz/go-getter v1.4.1-lite
|
github.com/yujunz/go-getter v1.4.1-lite
|
||||||
golang.org/x/tools v0.0.0-20191010075000-0337d82405ff
|
golang.org/x/tools v0.0.0-20191010075000-0337d82405ff
|
||||||
gopkg.in/yaml.v2 v2.2.8
|
gopkg.in/yaml.v2 v2.3.0
|
||||||
k8s.io/api v0.17.0
|
k8s.io/api v0.17.0
|
||||||
k8s.io/apimachinery v0.17.0
|
k8s.io/apimachinery v0.17.0
|
||||||
k8s.io/client-go v0.17.0
|
k8s.io/client-go v0.17.0
|
||||||
k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a
|
k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a
|
||||||
sigs.k8s.io/kustomize/kyaml v0.1.11
|
sigs.k8s.io/kustomize/kyaml v0.3.4
|
||||||
sigs.k8s.io/yaml v1.2.0
|
sigs.k8s.io/yaml v1.2.0
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -340,6 +340,7 @@ github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8
|
|||||||
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
|
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
|
||||||
github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
|
github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
|
||||||
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
|
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
|
||||||
|
github.com/qri-io/starlib v0.4.2-0.20200213133954-ff2e8cd5ef8d h1:K6eOUihrFLdZjZnA4XlRp864fmWXv9YTIk7VPLhRacA=
|
||||||
github.com/qri-io/starlib v0.4.2-0.20200213133954-ff2e8cd5ef8d/go.mod h1:7DPO4domFU579Ga6E61sB9VFNaniPVwJP5C4bBCu3wA=
|
github.com/qri-io/starlib v0.4.2-0.20200213133954-ff2e8cd5ef8d/go.mod h1:7DPO4domFU579Ga6E61sB9VFNaniPVwJP5C4bBCu3wA=
|
||||||
github.com/quasilyte/go-consistent v0.0.0-20190521200055-c6f3937de18c/go.mod h1:5STLWrekHfjyYwxBRVRXNOSewLJ3PWfDJd1VyTS21fI=
|
github.com/quasilyte/go-consistent v0.0.0-20190521200055-c6f3937de18c/go.mod h1:5STLWrekHfjyYwxBRVRXNOSewLJ3PWfDJd1VyTS21fI=
|
||||||
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
|
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
|
||||||
@@ -423,6 +424,7 @@ go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qL
|
|||||||
go.mongodb.org/mongo-driver v1.1.2/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM=
|
go.mongodb.org/mongo-driver v1.1.2/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM=
|
||||||
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
|
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
|
||||||
go.starlark.net v0.0.0-20190528202925-30ae18b8564f/go.mod h1:c1/X6cHgvdXj6pUlmWKMkuqRnW4K8x2vwt6JAaaircg=
|
go.starlark.net v0.0.0-20190528202925-30ae18b8564f/go.mod h1:c1/X6cHgvdXj6pUlmWKMkuqRnW4K8x2vwt6JAaaircg=
|
||||||
|
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 h1:+FNtrFTmVw0YZGpBGX56XDee331t6JAXeK2bcyhLOOc=
|
||||||
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5/go.mod h1:nmDLcffg48OtT/PSW0Hg7FvpRQsQh5OSqIylirxKC7o=
|
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5/go.mod h1:nmDLcffg48OtT/PSW0Hg7FvpRQsQh5OSqIylirxKC7o=
|
||||||
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
|
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
|
||||||
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
|
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
|
||||||
@@ -548,9 +550,10 @@ gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bl
|
|||||||
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
|
||||||
gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
|
gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
|
||||||
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
|
gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
|
||||||
|
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2 h1:XZx7nhd5GMaZpmDaEHFVafUZC7ya0fuo7cSJ3UCKYmM=
|
gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2 h1:XZx7nhd5GMaZpmDaEHFVafUZC7ya0fuo7cSJ3UCKYmM=
|
||||||
gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||||
@@ -577,8 +580,8 @@ 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/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 h1:Cq7MalBHYACRd6EesksG1Q8EoIAKOsiZviGKbOLIej4=
|
||||||
mvdan.cc/unparam v0.0.0-20190720180237-d51796306d8f/go.mod h1:4G1h5nDURzA3bwVMZIVpwbkw+04kSxk3rAtzlimaUJw=
|
mvdan.cc/unparam v0.0.0-20190720180237-d51796306d8f/go.mod h1:4G1h5nDURzA3bwVMZIVpwbkw+04kSxk3rAtzlimaUJw=
|
||||||
sigs.k8s.io/kustomize/kyaml v0.1.11 h1:/VvWxVIgH5gG1K4A7trgbyLgO3tRBiAWNhLFVU1HEmo=
|
sigs.k8s.io/kustomize/kyaml v0.3.4 h1:RhxnabYltv4mdD5+I7pIaJtae+eaTn4TiZqPT7K+C7A=
|
||||||
sigs.k8s.io/kustomize/kyaml v0.1.11/go.mod h1:72/rLkSi+L/pHM1oCjwrf3ClU+tH5kZQvvdLSqIHwWU=
|
sigs.k8s.io/kustomize/kyaml v0.3.4/go.mod h1:XJL84E6sOFeNrQ7CADiemc1B0EjIxHo3OhW4o1aJYNw=
|
||||||
sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI=
|
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.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
|
||||||
sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q=
|
sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q=
|
||||||
|
|||||||
@@ -41,33 +41,33 @@ type Loader interface {
|
|||||||
// Kunstructured allows manipulation of k8s objects
|
// Kunstructured allows manipulation of k8s objects
|
||||||
// that do not have Golang structs.
|
// that do not have Golang structs.
|
||||||
type Kunstructured interface {
|
type Kunstructured interface {
|
||||||
Map() map[string]interface{}
|
|
||||||
SetMap(map[string]interface{})
|
|
||||||
Copy() Kunstructured
|
Copy() Kunstructured
|
||||||
GetFieldValue(string) (interface{}, error)
|
GetAnnotations() map[string]string
|
||||||
GetString(string) (string, error)
|
|
||||||
GetStringSlice(string) ([]string, error)
|
|
||||||
GetBool(path string) (bool, error)
|
GetBool(path string) (bool, error)
|
||||||
|
GetFieldValue(string) (interface{}, error)
|
||||||
GetFloat64(path string) (float64, error)
|
GetFloat64(path string) (float64, error)
|
||||||
GetInt64(path string) (int64, error)
|
|
||||||
GetSlice(path string) ([]interface{}, error)
|
|
||||||
GetStringMap(path string) (map[string]string, error)
|
|
||||||
GetMap(path string) (map[string]interface{}, error)
|
|
||||||
MarshalJSON() ([]byte, error)
|
|
||||||
UnmarshalJSON([]byte) error
|
|
||||||
GetGvk() resid.Gvk
|
GetGvk() resid.Gvk
|
||||||
SetGvk(resid.Gvk)
|
GetInt64(path string) (int64, error)
|
||||||
GetKind() string
|
GetKind() string
|
||||||
|
GetLabels() map[string]string
|
||||||
|
GetMap(path string) (map[string]interface{}, error)
|
||||||
GetName() string
|
GetName() string
|
||||||
|
GetSlice(path string) ([]interface{}, error)
|
||||||
|
GetString(string) (string, error)
|
||||||
|
GetStringMap(path string) (map[string]string, error)
|
||||||
|
GetStringSlice(string) ([]string, error)
|
||||||
|
Map() map[string]interface{}
|
||||||
|
MarshalJSON() ([]byte, error)
|
||||||
|
MatchesAnnotationSelector(selector string) (bool, error)
|
||||||
|
MatchesLabelSelector(selector string) (bool, error)
|
||||||
|
Patch(Kunstructured) error
|
||||||
|
SetAnnotations(map[string]string)
|
||||||
|
SetGvk(resid.Gvk)
|
||||||
|
SetLabels(map[string]string)
|
||||||
|
SetMap(map[string]interface{})
|
||||||
SetName(string)
|
SetName(string)
|
||||||
SetNamespace(string)
|
SetNamespace(string)
|
||||||
GetLabels() map[string]string
|
UnmarshalJSON([]byte) error
|
||||||
SetLabels(map[string]string)
|
|
||||||
GetAnnotations() map[string]string
|
|
||||||
SetAnnotations(map[string]string)
|
|
||||||
MatchesLabelSelector(selector string) (bool, error)
|
|
||||||
MatchesAnnotationSelector(selector string) (bool, error)
|
|
||||||
Patch(Kunstructured) error
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// KunstructuredFactory makes instances of Kunstructured.
|
// KunstructuredFactory makes instances of Kunstructured.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM golang:1.11 AS build
|
FROM golang:1.14 AS build
|
||||||
|
|
||||||
ARG GO111MODULE=on
|
ARG GO111MODULE=on
|
||||||
|
|
||||||
|
|||||||
@@ -159,40 +159,31 @@ func main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
seedDocs := make(crawler.CrawlSeed, 0)
|
query := []byte(`{ "query":{ "match_all":{} } }`)
|
||||||
|
it := idx.IterateQuery(query, 10000, 60*time.Second)
|
||||||
// get all the documents in the index
|
|
||||||
getSeedDocsFunc := func() {
|
|
||||||
query := []byte(`{ "query":{ "match_all":{} } }`)
|
|
||||||
it := idx.IterateQuery(query, 10000, 60*time.Second)
|
|
||||||
for it.Next() {
|
|
||||||
for _, hit := range it.Value().Hits.Hits {
|
|
||||||
seedDocs = append(seedDocs, hit.Document.Document.Copy())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if err := it.Err(); err != nil {
|
|
||||||
log.Fatalf("getSeedDocsFunc Error iterating: %v\n", err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
switch mode {
|
switch mode {
|
||||||
case CrawlIndexAndGithub:
|
case CrawlIndexAndGithub:
|
||||||
getSeedDocsFunc()
|
|
||||||
crawlers := []crawler.Crawler{ghCrawlerConstructor("", "")}
|
crawlers := []crawler.Crawler{ghCrawlerConstructor("", "")}
|
||||||
crawler.CrawlFromSeed(ctx, seedDocs, crawlers, docConverter, indexFunc, seen)
|
crawler.CrawlFromSeedIterator(ctx, it, crawlers, docConverter, indexFunc, seen)
|
||||||
crawler.CrawlGithub(ctx, crawlers, docConverter, indexFunc, seen)
|
crawler.CrawlGithub(ctx, crawlers, docConverter, indexFunc, seen)
|
||||||
case CrawlIndex:
|
case CrawlIndex:
|
||||||
getSeedDocsFunc()
|
|
||||||
crawlers := []crawler.Crawler{ghCrawlerConstructor("", "")}
|
crawlers := []crawler.Crawler{ghCrawlerConstructor("", "")}
|
||||||
crawler.CrawlFromSeed(ctx, seedDocs, crawlers, docConverter, indexFunc, seen)
|
crawler.CrawlFromSeedIterator(ctx, it, crawlers, docConverter, indexFunc, seen)
|
||||||
case CrawlGithub:
|
case CrawlGithub:
|
||||||
crawlers := []crawler.Crawler{ghCrawlerConstructor("", "")}
|
crawlers := []crawler.Crawler{ghCrawlerConstructor("", "")}
|
||||||
// add all the documents in the index into seen.
|
// add all the documents in the index into seen.
|
||||||
// this greatly reduces the time overhead of CrawlGithub.
|
// this greatly reduces the time overhead of CrawlGithub.
|
||||||
getSeedDocsFunc()
|
for it.Next() {
|
||||||
for _, d := range seedDocs {
|
for _, hit := range it.Value().Hits.Hits {
|
||||||
seen[d.ID()] = d.FileType
|
d := hit.Document.Document
|
||||||
|
seen.Set(d.ID(), d.FileType)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
if err := it.Err(); err != nil {
|
||||||
|
log.Fatalf("Error iterating the index: %v\n", err)
|
||||||
|
}
|
||||||
|
|
||||||
crawler.CrawlGithub(ctx, crawlers, docConverter, indexFunc, seen)
|
crawler.CrawlGithub(ctx, crawlers, docConverter, indexFunc, seen)
|
||||||
case CrawlUser:
|
case CrawlUser:
|
||||||
if *githubUserPtr == "" {
|
if *githubUserPtr == "" {
|
||||||
|
|||||||
@@ -213,21 +213,36 @@ func doCrawl(ctx context.Context, docsPtr *CrawlSeed, crawlers []Crawler, conv C
|
|||||||
logger.Printf("\t%d documents cannot be converted but still were inserted or updated in the index\n", convErrCount)
|
logger.Printf("\t%d documents cannot be converted but still were inserted or updated in the index\n", convErrCount)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CrawlFromSeedIterator iterates all the documents in the index and call CrawlFromSeed for each document.
|
||||||
|
func CrawlFromSeedIterator(ctx context.Context, it *index.KustomizeIterator, crawlers []Crawler,
|
||||||
|
conv Converter, indx IndexFunc, seen utils.SeenMap) {
|
||||||
|
docCount := 0
|
||||||
|
for it.Next() {
|
||||||
|
for _, hit := range it.Value().Hits.Hits {
|
||||||
|
docCount++
|
||||||
|
logger.Printf("updating document %d from seed\n", docCount)
|
||||||
|
|
||||||
|
singleSeed := CrawlSeed{&(hit.Document.Document)}
|
||||||
|
CrawlFromSeed(ctx, singleSeed, crawlers, conv, indx, seen)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if err := it.Err(); err != nil {
|
||||||
|
log.Fatalf("Error iterating the index: %v\n", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// CrawlFromSeed updates all the documents in seed, and crawls all the new
|
// CrawlFromSeed updates all the documents in seed, and crawls all the new
|
||||||
// documents referred in the seed.
|
// documents referred in the seed.
|
||||||
func CrawlFromSeed(ctx context.Context, seed CrawlSeed, crawlers []Crawler,
|
func CrawlFromSeed(ctx context.Context, seed CrawlSeed, crawlers []Crawler,
|
||||||
conv Converter, indx IndexFunc, seen utils.SeenMap) {
|
conv Converter, indx IndexFunc, seen utils.SeenMap) {
|
||||||
|
|
||||||
// stack tracks the documents directly referred in other documents.
|
// stack tracks the documents directly referred in the seed.
|
||||||
stack := make(CrawlSeed, 0)
|
stack := make(CrawlSeed, 0)
|
||||||
|
|
||||||
// Exploit seed to update bulk of corpus.
|
|
||||||
logger.Printf("updating %d documents from seed\n", len(seed))
|
|
||||||
// each unique document in seed will be crawled once.
|
// each unique document in seed will be crawled once.
|
||||||
doCrawl(ctx, &seed, crawlers, conv, indx, seen, &stack, true, false)
|
doCrawl(ctx, &seed, crawlers, conv, indx, seen, &stack, true, false)
|
||||||
|
|
||||||
// Traverse any new documents added while updating corpus.
|
logger.Printf("crawling %d new documents referred by doc\n", len(stack))
|
||||||
logger.Printf("crawling %d new documents found in the seed\n", len(stack))
|
|
||||||
// While crawling each document in stack, the documents directly referred in the document
|
// While crawling each document in stack, the documents directly referred in the document
|
||||||
// will be added into stack.
|
// will be added into stack.
|
||||||
// After this statement is done, stack will become empty.
|
// After this statement is done, stack will become empty.
|
||||||
@@ -297,8 +312,6 @@ func CrawlGithubRunner(ctx context.Context, output chan<- CrawledDocument,
|
|||||||
// CrawlGithub crawls all the kustomization files on Github.
|
// CrawlGithub crawls all the kustomization files on Github.
|
||||||
func CrawlGithub(ctx context.Context, crawlers []Crawler, conv Converter,
|
func CrawlGithub(ctx context.Context, crawlers []Crawler, conv Converter,
|
||||||
indx IndexFunc, seen utils.SeenMap) {
|
indx IndexFunc, seen utils.SeenMap) {
|
||||||
// stack tracks the documents directly referred in other documents.
|
|
||||||
stack := make(CrawlSeed, 0)
|
|
||||||
|
|
||||||
// ch is channel where all the crawlers sends the crawled documents to.
|
// ch is channel where all the crawlers sends the crawled documents to.
|
||||||
ch := make(chan CrawledDocument, 1<<10)
|
ch := make(chan CrawledDocument, 1<<10)
|
||||||
@@ -324,7 +337,20 @@ func CrawlGithub(ctx context.Context, crawlers []Crawler, conv Converter,
|
|||||||
"%v could not match any crawler", cdoc))
|
"%v could not match any crawler", cdoc))
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// stack tracks the documents directly referred in the document.
|
||||||
|
stack := make(CrawlSeed, 0)
|
||||||
|
|
||||||
addBranches(cdoc, match, indx, seen, &stack)
|
addBranches(cdoc, match, indx, seen, &stack)
|
||||||
|
|
||||||
|
if len(stack) > 0 {
|
||||||
|
// here the documents referred in a kustomization file are crawled separately,
|
||||||
|
// to avoid accumulating all the referred documents into a single gigantic
|
||||||
|
// mem-inentive stack.
|
||||||
|
logger.Printf("crawling the %d new documents referred in doc %d",
|
||||||
|
len(stack), docCount)
|
||||||
|
doCrawl(ctx, &stack, crawlers, conv, indx, seen, &stack, false, true)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
@@ -336,9 +362,4 @@ func CrawlGithub(ctx context.Context, crawlers []Crawler, conv Converter,
|
|||||||
}
|
}
|
||||||
close(ch)
|
close(ch)
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
|
|
||||||
// Handle deps of newly discovered documents.
|
|
||||||
logger.Printf("crawling the %d new documents referred by other documents",
|
|
||||||
len(stack))
|
|
||||||
doCrawl(ctx, &stack, crawlers, conv, indx, seen, &stack, false, true)
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,14 +82,15 @@ func (gc githubCrawler) Crawl(ctx context.Context,
|
|||||||
|
|
||||||
ranges := []RangeWithin{
|
ranges := []RangeWithin{
|
||||||
RangeWithin{
|
RangeWithin{
|
||||||
start: uint64(0),
|
start: uint64(0),
|
||||||
end: githubMaxFileSize,
|
end: githubMaxFileSize,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
errs := make(multiError, 0)
|
errs := make(multiError, 0)
|
||||||
for len(ranges) > 0 {
|
for len(ranges) > 0 {
|
||||||
tailRange := ranges[len(ranges) - 1]
|
logger.Printf("Current ranges: %v (len: %d)\n", ranges, len(ranges))
|
||||||
|
tailRange := ranges[len(ranges)-1]
|
||||||
ranges = ranges[:(len(ranges) - 1)]
|
ranges = ranges[:(len(ranges) - 1)]
|
||||||
reProcessQueryRanges, err := gc.CrawlSingleRange(ctx, output, seen, tailRange.start, tailRange.end)
|
reProcessQueryRanges, err := gc.CrawlSingleRange(ctx, output, seen, tailRange.start, tailRange.end)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -151,7 +152,15 @@ func (gc githubCrawler) CrawlSingleRange(ctx context.Context,
|
|||||||
}
|
}
|
||||||
queryResult.Add(rangeResult)
|
queryResult.Add(rangeResult)
|
||||||
if reProcessQuery {
|
if reProcessQuery {
|
||||||
reProcessQueryRanges = append(reProcessQueryRanges, RangeSizes(query))
|
// if the size of a range is 0, such as [245, 245], and reProcessQuery is true,
|
||||||
|
// it means that there are more than 1000 results for the query range.
|
||||||
|
// Reprocessing the query range will not help because the GitHub Search API
|
||||||
|
// only provides up to 1,000 results for each search.
|
||||||
|
if RangeSizes(query).Size() == 0 {
|
||||||
|
logger.Printf("range size is 0 includes more than 1000 results: %s", query)
|
||||||
|
} else {
|
||||||
|
reProcessQueryRanges = append(reProcessQueryRanges, RangeSizes(query))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -225,3 +225,7 @@ type RangeWithin struct {
|
|||||||
func (r RangeWithin) RangeString() string {
|
func (r RangeWithin) RangeString() string {
|
||||||
return fmt.Sprintf("%d..%d", r.start, r.end)
|
return fmt.Sprintf("%d..%d", r.start, r.end)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (r RangeWithin) Size() uint64 {
|
||||||
|
return r.end - r.start
|
||||||
|
}
|
||||||
|
|||||||
@@ -189,13 +189,8 @@ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+
|
|||||||
github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d h1:7XGaL1e6bYS1yIonGp9761ExpPPV1ui0SAC59Yube9k=
|
github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d h1:7XGaL1e6bYS1yIonGp9761ExpPPV1ui0SAC59Yube9k=
|
||||||
github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY=
|
github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY=
|
||||||
github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8=
|
github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8=
|
||||||
github.com/gorilla/context v0.0.0-20160226214623-1ea25387ff6f/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
|
|
||||||
github.com/gorilla/mux v1.6.0/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
|
|
||||||
github.com/gorilla/mux v1.7.3 h1:gnP5JzjVOuiZD07fKKToCAOjS0yOpj/qPETTXCCS6hw=
|
github.com/gorilla/mux v1.7.3 h1:gnP5JzjVOuiZD07fKKToCAOjS0yOpj/qPETTXCCS6hw=
|
||||||
github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
|
github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
|
||||||
github.com/gorilla/securecookie v0.0.0-20160422134519-667fe4e3466a/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4=
|
|
||||||
github.com/gorilla/sessions v0.0.0-20160922145804-ca9ada445741/go.mod h1:+WVp8kdw6VhyKExm03PAMRn2ZxnPtm58pV0dBVPdhHE=
|
|
||||||
github.com/gorilla/websocket v1.2.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
|
|
||||||
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
|
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
|
||||||
github.com/gostaticanalysis/analysisutil v0.0.0-20190318220348-4088753ea4d3/go.mod h1:eEOZF4jCKGi+aprrirO9e7WKB3beBRtWgqGunKl6pKE=
|
github.com/gostaticanalysis/analysisutil v0.0.0-20190318220348-4088753ea4d3/go.mod h1:eEOZF4jCKGi+aprrirO9e7WKB3beBRtWgqGunKl6pKE=
|
||||||
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
|
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
|
||||||
@@ -268,7 +263,6 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN
|
|||||||
github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI=
|
github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI=
|
||||||
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||||
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8=
|
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8=
|
||||||
github.com/monopole/mdrip v1.0.1/go.mod h1:/7E04hlzRG9Jrp6WILZfYYm/REoJWL2l+MlsCO1eH74=
|
|
||||||
github.com/mozilla/tls-observatory v0.0.0-20190404164649-a3c1b6cfecfd/go.mod h1:SrKMQvPiws7F7iqYp8/TX+IhxCYhzr6N/1yb8cwHsGk=
|
github.com/mozilla/tls-observatory v0.0.0-20190404164649-a3c1b6cfecfd/go.mod h1:SrKMQvPiws7F7iqYp8/TX+IhxCYhzr6N/1yb8cwHsGk=
|
||||||
github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
|
github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
|
||||||
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
|
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
|
||||||
@@ -489,7 +483,6 @@ gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMy
|
|||||||
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
|
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
|
||||||
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
|
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
|
||||||
gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
|
gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
|
||||||
gopkg.in/russross/blackfriday.v2 v2.0.0/go.mod h1:6sSBNz/GtOm/pJTuh5UmBK2ZHfmnxGbl2NZg1UliSOI=
|
|
||||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
|
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
|
||||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
|
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
|
||||||
gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
|
gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
|
||||||
@@ -497,9 +490,10 @@ gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
|||||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I=
|
gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I=
|
||||||
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
|
||||||
gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
|
gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
|
||||||
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
|
gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
|
||||||
|
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||||
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||||
@@ -521,7 +515,7 @@ 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/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/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=
|
mvdan.cc/unparam v0.0.0-20190720180237-d51796306d8f/go.mod h1:4G1h5nDURzA3bwVMZIVpwbkw+04kSxk3rAtzlimaUJw=
|
||||||
sigs.k8s.io/kustomize/kyaml v0.1.11/go.mod h1:72/rLkSi+L/pHM1oCjwrf3ClU+tH5kZQvvdLSqIHwWU=
|
sigs.k8s.io/kustomize/kyaml v0.3.4/go.mod h1:XJL84E6sOFeNrQ7CADiemc1B0EjIxHo3OhW4o1aJYNw=
|
||||||
sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI=
|
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 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs=
|
||||||
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
|
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
|
||||||
|
|||||||
@@ -1,21 +1,37 @@
|
|||||||
package utils
|
package utils
|
||||||
|
|
||||||
type SeenMap map[string]string
|
import "sync"
|
||||||
|
|
||||||
|
type SeenMap struct {
|
||||||
|
data map[string]string
|
||||||
|
lock sync.RWMutex
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: add lock to avoid race condition
|
||||||
func (seen SeenMap) Seen(item string) bool {
|
func (seen SeenMap) Seen(item string) bool {
|
||||||
_, ok := seen[item]
|
seen.lock.RLock()
|
||||||
|
_, ok := seen.data[item]
|
||||||
|
seen.lock.RUnlock()
|
||||||
return ok
|
return ok
|
||||||
}
|
}
|
||||||
|
|
||||||
func (seen SeenMap) Set(k, v string) {
|
func (seen SeenMap) Set(k, v string) {
|
||||||
seen[k] = v
|
seen.lock.Lock()
|
||||||
|
seen.data[k] = v
|
||||||
|
seen.lock.Unlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
// The caller should make sure that key is in the map.
|
// The caller should make sure that key is in the map.
|
||||||
func (seen SeenMap) Value(k string) string {
|
func (seen SeenMap) Value(k string) string {
|
||||||
return seen[k]
|
seen.lock.RLock()
|
||||||
|
v := seen.data[k]
|
||||||
|
seen.lock.RUnlock()
|
||||||
|
return v
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewSeenMap() SeenMap {
|
func NewSeenMap() SeenMap {
|
||||||
return make(map[string]string)
|
return SeenMap{
|
||||||
|
data: make(map[string]string),
|
||||||
|
lock: sync.RWMutex{},
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,22 +9,17 @@ import (
|
|||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"strconv"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/google/shlex"
|
"github.com/google/shlex"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"sigs.k8s.io/kustomize/api/resid"
|
"sigs.k8s.io/kustomize/api/internal/plugins/utils"
|
||||||
"sigs.k8s.io/kustomize/api/resmap"
|
"sigs.k8s.io/kustomize/api/resmap"
|
||||||
"sigs.k8s.io/kustomize/api/types"
|
|
||||||
"sigs.k8s.io/yaml"
|
"sigs.k8s.io/yaml"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
idAnnotation = "kustomize.config.k8s.io/id"
|
|
||||||
HashAnnotation = "kustomize.config.k8s.io/needs-hash"
|
|
||||||
BehaviorAnnotation = "kustomize.config.k8s.io/behavior"
|
|
||||||
tmpConfigFilePrefix = "kust-plugin-config-"
|
tmpConfigFilePrefix = "kust-plugin-config-"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -114,12 +109,12 @@ func (p *ExecPlugin) Generate() (resmap.ResMap, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return p.UpdateResourceOptions(rm)
|
return utils.UpdateResourceOptions(rm)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *ExecPlugin) Transform(rm resmap.ResMap) error {
|
func (p *ExecPlugin) Transform(rm resmap.ResMap) error {
|
||||||
// add ResIds as annotations to all objects so that we can add them back
|
// add ResIds as annotations to all objects so that we can add them back
|
||||||
inputRM, err := p.getResMapWithIdAnnotation(rm)
|
inputRM, err := utils.GetResMapWithIDAnnotation(rm)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -137,7 +132,7 @@ func (p *ExecPlugin) Transform(rm resmap.ResMap) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// update the original ResMap based on the output
|
// update the original ResMap based on the output
|
||||||
return p.updateResMapValues(output, rm)
|
return utils.UpdateResMapValues(p.path, p.h, output, rm)
|
||||||
}
|
}
|
||||||
|
|
||||||
// invokePlugin writes plugin config to a temp file, then
|
// invokePlugin writes plugin config to a temp file, then
|
||||||
@@ -184,91 +179,3 @@ func (p *ExecPlugin) getEnv() []string {
|
|||||||
"KUSTOMIZE_PLUGIN_CONFIG_ROOT="+p.h.Loader().Root())
|
"KUSTOMIZE_PLUGIN_CONFIG_ROOT="+p.h.Loader().Root())
|
||||||
return env
|
return env
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns a new copy of the given ResMap with the ResIds annotated in each Resource
|
|
||||||
func (p *ExecPlugin) getResMapWithIdAnnotation(rm resmap.ResMap) (resmap.ResMap, error) {
|
|
||||||
inputRM := rm.DeepCopy()
|
|
||||||
for _, r := range inputRM.Resources() {
|
|
||||||
idString, err := yaml.Marshal(r.CurId())
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
annotations := r.GetAnnotations()
|
|
||||||
if annotations == nil {
|
|
||||||
annotations = make(map[string]string)
|
|
||||||
}
|
|
||||||
annotations[idAnnotation] = string(idString)
|
|
||||||
r.SetAnnotations(annotations)
|
|
||||||
}
|
|
||||||
return inputRM, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// updateResMapValues updates the Resource value in the given ResMap
|
|
||||||
// with the emitted Resource values in output.
|
|
||||||
func (p *ExecPlugin) updateResMapValues(output []byte, rm resmap.ResMap) error {
|
|
||||||
outputRM, err := p.h.ResmapFactory().NewResMapFromBytes(output)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
for _, r := range outputRM.Resources() {
|
|
||||||
// for each emitted Resource, find the matching Resource in the original ResMap
|
|
||||||
// using its id
|
|
||||||
annotations := r.GetAnnotations()
|
|
||||||
idString, ok := annotations[idAnnotation]
|
|
||||||
if !ok {
|
|
||||||
return fmt.Errorf("the transformer %s should not remove annotation %s",
|
|
||||||
p.path, idAnnotation)
|
|
||||||
}
|
|
||||||
id := resid.ResId{}
|
|
||||||
err := yaml.Unmarshal([]byte(idString), &id)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
res, err := rm.GetByCurrentId(id)
|
|
||||||
if err != nil {
|
|
||||||
return fmt.Errorf("unable to find unique match to %s", id.String())
|
|
||||||
}
|
|
||||||
// remove the annotation set by Kustomize to track the resource
|
|
||||||
delete(annotations, idAnnotation)
|
|
||||||
if len(annotations) == 0 {
|
|
||||||
annotations = nil
|
|
||||||
}
|
|
||||||
r.SetAnnotations(annotations)
|
|
||||||
|
|
||||||
// update the ResMap resource value with the transformed object
|
|
||||||
res.Kunstructured = r.Kunstructured
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// updateResourceOptions updates the generator options for each resource in the
|
|
||||||
// given ResMap based on plugin provided annotations.
|
|
||||||
func (p *ExecPlugin) UpdateResourceOptions(rm resmap.ResMap) (resmap.ResMap, error) {
|
|
||||||
for _, r := range rm.Resources() {
|
|
||||||
// Disable name hashing by default and require plugin to explicitly
|
|
||||||
// request it for each resource.
|
|
||||||
annotations := r.GetAnnotations()
|
|
||||||
behavior := annotations[BehaviorAnnotation]
|
|
||||||
var needsHash bool
|
|
||||||
if val, ok := annotations[HashAnnotation]; ok {
|
|
||||||
b, err := strconv.ParseBool(val)
|
|
||||||
if err != nil {
|
|
||||||
return nil, fmt.Errorf(
|
|
||||||
"the annotation %q contains an invalid value (%q)",
|
|
||||||
HashAnnotation, val)
|
|
||||||
}
|
|
||||||
needsHash = b
|
|
||||||
}
|
|
||||||
delete(annotations, HashAnnotation)
|
|
||||||
delete(annotations, BehaviorAnnotation)
|
|
||||||
if len(annotations) == 0 {
|
|
||||||
annotations = nil
|
|
||||||
}
|
|
||||||
r.SetAnnotations(annotations)
|
|
||||||
r.SetOptions(types.NewGenArgs(
|
|
||||||
&types.GeneratorArgs{
|
|
||||||
Behavior: behavior,
|
|
||||||
Options: &types.GeneratorOptions{DisableNameSuffixHash: !needsHash}}))
|
|
||||||
}
|
|
||||||
return rm, nil
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
package execplugin_test
|
package execplugin_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
@@ -17,7 +16,6 @@ import (
|
|||||||
"sigs.k8s.io/kustomize/api/resmap"
|
"sigs.k8s.io/kustomize/api/resmap"
|
||||||
"sigs.k8s.io/kustomize/api/resource"
|
"sigs.k8s.io/kustomize/api/resource"
|
||||||
valtest_test "sigs.k8s.io/kustomize/api/testutils/valtest"
|
valtest_test "sigs.k8s.io/kustomize/api/testutils/valtest"
|
||||||
"sigs.k8s.io/kustomize/api/types"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestExecPluginConfig(t *testing.T) {
|
func TestExecPluginConfig(t *testing.T) {
|
||||||
@@ -91,107 +89,3 @@ metadata:
|
|||||||
t.Fatalf("unexpected arg array: %#v", p.Args())
|
t.Fatalf("unexpected arg array: %#v", p.Args())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func makeConfigMap(rf *resource.Factory, name, behavior string, hashValue *string) *resource.Resource {
|
|
||||||
r := rf.FromMap(map[string]interface{}{
|
|
||||||
"apiVersion": "v1",
|
|
||||||
"kind": "ConfigMap",
|
|
||||||
"metadata": map[string]interface{}{"name": name},
|
|
||||||
})
|
|
||||||
annotations := map[string]string{}
|
|
||||||
if behavior != "" {
|
|
||||||
annotations[BehaviorAnnotation] = behavior
|
|
||||||
}
|
|
||||||
if hashValue != nil {
|
|
||||||
annotations[HashAnnotation] = *hashValue
|
|
||||||
}
|
|
||||||
if len(annotations) > 0 {
|
|
||||||
r.SetAnnotations(annotations)
|
|
||||||
}
|
|
||||||
return r
|
|
||||||
}
|
|
||||||
|
|
||||||
func makeConfigMapOptions(rf *resource.Factory, name, behavior string, disableHash bool) *resource.Resource {
|
|
||||||
return rf.FromMapAndOption(map[string]interface{}{
|
|
||||||
"apiVersion": "v1",
|
|
||||||
"kind": "ConfigMap",
|
|
||||||
"metadata": map[string]interface{}{"name": name},
|
|
||||||
}, &types.GeneratorArgs{
|
|
||||||
Behavior: behavior,
|
|
||||||
Options: &types.GeneratorOptions{DisableNameSuffixHash: disableHash}})
|
|
||||||
}
|
|
||||||
|
|
||||||
func strptr(s string) *string {
|
|
||||||
return &s
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestUpdateResourceOptions(t *testing.T) {
|
|
||||||
p := NewExecPlugin("")
|
|
||||||
if err := p.ErrIfNotExecutable(); err == nil {
|
|
||||||
t.Fatalf("expected unexecutable error")
|
|
||||||
}
|
|
||||||
rf := resource.NewFactory(kunstruct.NewKunstructuredFactoryImpl())
|
|
||||||
in := resmap.New()
|
|
||||||
expected := resmap.New()
|
|
||||||
cases := []struct {
|
|
||||||
behavior string
|
|
||||||
needsHash bool
|
|
||||||
hashValue *string
|
|
||||||
}{
|
|
||||||
{hashValue: strptr("false")},
|
|
||||||
{hashValue: strptr("true"), needsHash: true},
|
|
||||||
{behavior: "replace"},
|
|
||||||
{behavior: "merge"},
|
|
||||||
{behavior: "create"},
|
|
||||||
{behavior: "nonsense"},
|
|
||||||
{behavior: "merge", hashValue: strptr("false")},
|
|
||||||
{behavior: "merge", hashValue: strptr("true"), needsHash: true},
|
|
||||||
}
|
|
||||||
for i, c := range cases {
|
|
||||||
name := fmt.Sprintf("test%d", i)
|
|
||||||
in.Append(makeConfigMap(rf, name, c.behavior, c.hashValue))
|
|
||||||
expected.Append(makeConfigMapOptions(rf, name, c.behavior, !c.needsHash))
|
|
||||||
}
|
|
||||||
actual, err := p.UpdateResourceOptions(in)
|
|
||||||
if err != nil {
|
|
||||||
t.Fatalf("unexpected error: %v", err.Error())
|
|
||||||
}
|
|
||||||
for i, a := range expected.Resources() {
|
|
||||||
b := actual.GetByIndex(i)
|
|
||||||
if b == nil {
|
|
||||||
t.Fatalf("resource %d missing from processed map", i)
|
|
||||||
}
|
|
||||||
if !a.Equals(b) {
|
|
||||||
t.Errorf("expected %v got %v", a, b)
|
|
||||||
}
|
|
||||||
if a.NeedHashSuffix() != b.NeedHashSuffix() {
|
|
||||||
t.Errorf("")
|
|
||||||
}
|
|
||||||
if a.Behavior() != b.Behavior() {
|
|
||||||
t.Errorf("expected %v got %v", a.Behavior(), b.Behavior())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestUpdateResourceOptionsWithInvalidHashAnnotationValues(t *testing.T) {
|
|
||||||
p := NewExecPlugin("")
|
|
||||||
if err := p.ErrIfNotExecutable(); err == nil {
|
|
||||||
t.Fatalf("expected unexecutable error")
|
|
||||||
}
|
|
||||||
rf := resource.NewFactory(kunstruct.NewKunstructuredFactoryImpl())
|
|
||||||
cases := []string{
|
|
||||||
"",
|
|
||||||
"FaLsE",
|
|
||||||
"TrUe",
|
|
||||||
"potato",
|
|
||||||
}
|
|
||||||
for i, c := range cases {
|
|
||||||
name := fmt.Sprintf("test%d", i)
|
|
||||||
in := resmap.New()
|
|
||||||
in.Append(makeConfigMap(rf, name, "", &c))
|
|
||||||
_, err := p.UpdateResourceOptions(in)
|
|
||||||
if err == nil {
|
|
||||||
t.Errorf("expected error from value %q", c)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
197
api/internal/plugins/fnplugin/fnplugin.go
Normal file
197
api/internal/plugins/fnplugin/fnplugin.go
Normal file
@@ -0,0 +1,197 @@
|
|||||||
|
// Copyright 2019 The Kubernetes Authors.
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
package fnplugin
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bytes"
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/pkg/errors"
|
||||||
|
|
||||||
|
"sigs.k8s.io/kustomize/api/internal/plugins/utils"
|
||||||
|
"sigs.k8s.io/kustomize/api/resmap"
|
||||||
|
"sigs.k8s.io/kustomize/api/resource"
|
||||||
|
"sigs.k8s.io/kustomize/api/types"
|
||||||
|
"sigs.k8s.io/kustomize/kyaml/fn/runtime/runtimeutil"
|
||||||
|
"sigs.k8s.io/kustomize/kyaml/runfn"
|
||||||
|
"sigs.k8s.io/kustomize/kyaml/yaml"
|
||||||
|
)
|
||||||
|
|
||||||
|
// FnPlugin is the struct to hold function information
|
||||||
|
type FnPlugin struct {
|
||||||
|
// Function runner
|
||||||
|
runFns runfn.RunFns
|
||||||
|
|
||||||
|
// Plugin configuration data.
|
||||||
|
cfg []byte
|
||||||
|
|
||||||
|
// Plugin name cache for error output
|
||||||
|
pluginName string
|
||||||
|
|
||||||
|
// PluginHelpers
|
||||||
|
h *resmap.PluginHelpers
|
||||||
|
}
|
||||||
|
|
||||||
|
func bytesToRNode(yml []byte) (*yaml.RNode, error) {
|
||||||
|
rnode, err := yaml.Parse(string(yml))
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return rnode, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func resourceToRNode(res *resource.Resource) (*yaml.RNode, error) {
|
||||||
|
yml, err := res.AsYAML()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return bytesToRNode(yml)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetFunctionSpec return function spec is there is. Otherwise return nil
|
||||||
|
func GetFunctionSpec(res *resource.Resource) *runtimeutil.FunctionSpec {
|
||||||
|
rnode, err := resourceToRNode(res)
|
||||||
|
if err != nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
return runtimeutil.GetFunctionSpec(rnode)
|
||||||
|
}
|
||||||
|
|
||||||
|
func toStorageMounts(mounts []string) []runtimeutil.StorageMount {
|
||||||
|
var sms []runtimeutil.StorageMount
|
||||||
|
for _, mount := range mounts {
|
||||||
|
sms = append(sms, runtimeutil.StringToStorageMount(mount))
|
||||||
|
}
|
||||||
|
return sms
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewFnPlugin creates a FnPlugin struct
|
||||||
|
func NewFnPlugin(o *types.FnPluginLoadingOptions) *FnPlugin {
|
||||||
|
return &FnPlugin{
|
||||||
|
runFns: runfn.RunFns{
|
||||||
|
Functions: []*yaml.RNode{},
|
||||||
|
Network: o.Network,
|
||||||
|
NetworkName: o.NetworkName,
|
||||||
|
EnableStarlark: o.EnableStar,
|
||||||
|
EnableExec: o.EnableExec,
|
||||||
|
StorageMounts: toStorageMounts(o.Mounts),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Cfg returns function config
|
||||||
|
func (p *FnPlugin) Cfg() []byte {
|
||||||
|
return p.cfg
|
||||||
|
}
|
||||||
|
|
||||||
|
// Config is called by kustomize to pass-in config information
|
||||||
|
func (p *FnPlugin) Config(h *resmap.PluginHelpers, config []byte) error {
|
||||||
|
p.h = h
|
||||||
|
p.cfg = config
|
||||||
|
|
||||||
|
fn, err := bytesToRNode(p.cfg)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
meta, err := fn.GetMeta()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
p.pluginName = fmt.Sprintf("api: %s, kind: %s, name: %s",
|
||||||
|
meta.APIVersion, meta.Kind, meta.Name)
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Generate is called when run as generator
|
||||||
|
func (p *FnPlugin) Generate() (resmap.ResMap, error) {
|
||||||
|
output, err := p.invokePlugin(nil)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
rm, err := p.h.ResmapFactory().NewResMapFromBytes(output)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return utils.UpdateResourceOptions(rm)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Transform is called when run as transformer
|
||||||
|
func (p *FnPlugin) Transform(rm resmap.ResMap) error {
|
||||||
|
// add ResIds as annotations to all objects so that we can add them back
|
||||||
|
inputRM, err := utils.GetResMapWithIDAnnotation(rm)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// encode the ResMap so it can be fed to the plugin
|
||||||
|
resources, err := inputRM.AsYaml()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// invoke the plugin with resources as the input
|
||||||
|
output, err := p.invokePlugin(resources)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("%v %s", err, string(output))
|
||||||
|
}
|
||||||
|
|
||||||
|
// update the original ResMap based on the output
|
||||||
|
return utils.UpdateResMapValues(p.pluginName, p.h, output, rm)
|
||||||
|
}
|
||||||
|
|
||||||
|
func injectAnnotation(input *yaml.RNode, k, v string) error {
|
||||||
|
err := input.PipeE(yaml.SetAnnotation(k, v))
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// invokePlugin uses Function runner to run function as plugin
|
||||||
|
func (p *FnPlugin) invokePlugin(input []byte) ([]byte, error) {
|
||||||
|
// get function config rnode
|
||||||
|
functionConfig, err := bytesToRNode(p.cfg)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
// This annotation will let kustomize ingnore this item in output
|
||||||
|
err = injectAnnotation(functionConfig, "config.kubernetes.io/local-config", "true")
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
// we need to add config as input for generators. Some of them don't work with FunctionConfig
|
||||||
|
// and in addition kio.Pipeline won't create anything if there are no objects
|
||||||
|
// see https://github.com/kubernetes-sigs/kustomize/blob/master/kyaml/kio/kio.go#L93
|
||||||
|
// Since we added `local-config` annotation so it will be ignored in generator output
|
||||||
|
// TODO(donnyxia): This is actually not used by generator and only used to bypass a kio limitation.
|
||||||
|
// Need better solution.
|
||||||
|
if input == nil {
|
||||||
|
yaml, err := functionConfig.String()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
input = []byte(yaml)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Configure and Execute Fn. We don't need to convert resources to ResourceList here
|
||||||
|
// because function runtime will do that. See kyaml/fn/runtime/runtimeutil/runtimeutil.go
|
||||||
|
var ouputBuffer bytes.Buffer
|
||||||
|
p.runFns.Input = bytes.NewReader(input)
|
||||||
|
p.runFns.Functions = append(p.runFns.Functions, functionConfig)
|
||||||
|
p.runFns.Output = &ouputBuffer
|
||||||
|
|
||||||
|
err = p.runFns.Execute()
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.Wrap(
|
||||||
|
err, "couldn't execute function")
|
||||||
|
}
|
||||||
|
|
||||||
|
return ouputBuffer.Bytes(), nil
|
||||||
|
}
|
||||||
@@ -16,6 +16,7 @@ import (
|
|||||||
"sigs.k8s.io/kustomize/api/ifc"
|
"sigs.k8s.io/kustomize/api/ifc"
|
||||||
"sigs.k8s.io/kustomize/api/internal/plugins/builtinhelpers"
|
"sigs.k8s.io/kustomize/api/internal/plugins/builtinhelpers"
|
||||||
"sigs.k8s.io/kustomize/api/internal/plugins/execplugin"
|
"sigs.k8s.io/kustomize/api/internal/plugins/execplugin"
|
||||||
|
"sigs.k8s.io/kustomize/api/internal/plugins/fnplugin"
|
||||||
"sigs.k8s.io/kustomize/api/internal/plugins/utils"
|
"sigs.k8s.io/kustomize/api/internal/plugins/utils"
|
||||||
"sigs.k8s.io/kustomize/api/konfig"
|
"sigs.k8s.io/kustomize/api/konfig"
|
||||||
"sigs.k8s.io/kustomize/api/resid"
|
"sigs.k8s.io/kustomize/api/resid"
|
||||||
@@ -116,7 +117,7 @@ func (l *Loader) loadAndConfigurePlugin(
|
|||||||
if isBuiltinPlugin(res) {
|
if isBuiltinPlugin(res) {
|
||||||
switch l.pc.BpLoadingOptions {
|
switch l.pc.BpLoadingOptions {
|
||||||
case types.BploLoadFromFileSys:
|
case types.BploLoadFromFileSys:
|
||||||
c, err = l.loadPlugin(res.OrgId())
|
c, err = l.loadPlugin(res)
|
||||||
case types.BploUseStaticallyLinked:
|
case types.BploUseStaticallyLinked:
|
||||||
// Instead of looking for and loading a .so file,
|
// Instead of looking for and loading a .so file,
|
||||||
// instantiate the plugin from a generated factory
|
// instantiate the plugin from a generated factory
|
||||||
@@ -131,7 +132,7 @@ func (l *Loader) loadAndConfigurePlugin(
|
|||||||
} else {
|
} else {
|
||||||
switch l.pc.PluginRestrictions {
|
switch l.pc.PluginRestrictions {
|
||||||
case types.PluginRestrictionsNone:
|
case types.PluginRestrictionsNone:
|
||||||
c, err = l.loadPlugin(res.OrgId())
|
c, err = l.loadPlugin(res)
|
||||||
case types.PluginRestrictionsBuiltinsOnly:
|
case types.PluginRestrictionsBuiltinsOnly:
|
||||||
err = types.NewErrOnlyBuiltinPluginsAllowed(res.OrgId().Kind)
|
err = types.NewErrOnlyBuiltinPluginsAllowed(res.OrgId().Kind)
|
||||||
default:
|
default:
|
||||||
@@ -166,7 +167,15 @@ func (l *Loader) makeBuiltinPlugin(r resid.Gvk) (resmap.Configurable, error) {
|
|||||||
return nil, errors.Errorf("unable to load builtin %s", r)
|
return nil, errors.Errorf("unable to load builtin %s", r)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (l *Loader) loadPlugin(resId resid.ResId) (resmap.Configurable, error) {
|
func (l *Loader) loadPlugin(res *resource.Resource) (resmap.Configurable, error) {
|
||||||
|
spec := fnplugin.GetFunctionSpec(res)
|
||||||
|
if spec != nil {
|
||||||
|
return fnplugin.NewFnPlugin(&l.pc.FnpLoadingOptions), nil
|
||||||
|
}
|
||||||
|
return l.loadExecOrGoPlugin(res.OrgId())
|
||||||
|
}
|
||||||
|
|
||||||
|
func (l *Loader) loadExecOrGoPlugin(resId resid.ResId) (resmap.Configurable, error) {
|
||||||
// First try to load the plugin as an executable.
|
// First try to load the plugin as an executable.
|
||||||
p := execplugin.NewExecPlugin(l.absolutePluginPath(resId))
|
p := execplugin.NewExecPlugin(l.absolutePluginPath(resId))
|
||||||
err := p.ErrIfNotExecutable()
|
err := p.ErrIfNotExecutable()
|
||||||
|
|||||||
@@ -4,13 +4,25 @@
|
|||||||
package utils
|
package utils
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"sigs.k8s.io/kustomize/api/filesys"
|
"sigs.k8s.io/kustomize/api/filesys"
|
||||||
"sigs.k8s.io/kustomize/api/konfig"
|
"sigs.k8s.io/kustomize/api/konfig"
|
||||||
|
"sigs.k8s.io/kustomize/api/resid"
|
||||||
|
"sigs.k8s.io/kustomize/api/resmap"
|
||||||
|
"sigs.k8s.io/kustomize/api/types"
|
||||||
|
"sigs.k8s.io/yaml"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
idAnnotation = "kustomize.config.k8s.io/id"
|
||||||
|
HashAnnotation = "kustomize.config.k8s.io/needs-hash"
|
||||||
|
BehaviorAnnotation = "kustomize.config.k8s.io/behavior"
|
||||||
)
|
)
|
||||||
|
|
||||||
func GoBin() string {
|
func GoBin() string {
|
||||||
@@ -113,3 +125,91 @@ func FileExists(path string) bool {
|
|||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetResMapWithIDAnnotation returns a new copy of the given ResMap with the ResIds annotated in each Resource
|
||||||
|
func GetResMapWithIDAnnotation(rm resmap.ResMap) (resmap.ResMap, error) {
|
||||||
|
inputRM := rm.DeepCopy()
|
||||||
|
for _, r := range inputRM.Resources() {
|
||||||
|
idString, err := yaml.Marshal(r.CurId())
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
annotations := r.GetAnnotations()
|
||||||
|
if annotations == nil {
|
||||||
|
annotations = make(map[string]string)
|
||||||
|
}
|
||||||
|
annotations[idAnnotation] = string(idString)
|
||||||
|
r.SetAnnotations(annotations)
|
||||||
|
}
|
||||||
|
return inputRM, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// UpdateResMapValues updates the Resource value in the given ResMap
|
||||||
|
// with the emitted Resource values in output.
|
||||||
|
func UpdateResMapValues(pluginName string, h *resmap.PluginHelpers, output []byte, rm resmap.ResMap) error {
|
||||||
|
outputRM, err := h.ResmapFactory().NewResMapFromBytes(output)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
for _, r := range outputRM.Resources() {
|
||||||
|
// for each emitted Resource, find the matching Resource in the original ResMap
|
||||||
|
// using its id
|
||||||
|
annotations := r.GetAnnotations()
|
||||||
|
idString, ok := annotations[idAnnotation]
|
||||||
|
if !ok {
|
||||||
|
return fmt.Errorf("the transformer %s should not remove annotation %s",
|
||||||
|
pluginName, idAnnotation)
|
||||||
|
}
|
||||||
|
id := resid.ResId{}
|
||||||
|
err := yaml.Unmarshal([]byte(idString), &id)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
res, err := rm.GetByCurrentId(id)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("unable to find unique match to %s", id.String())
|
||||||
|
}
|
||||||
|
// remove the annotation set by Kustomize to track the resource
|
||||||
|
delete(annotations, idAnnotation)
|
||||||
|
if len(annotations) == 0 {
|
||||||
|
annotations = nil
|
||||||
|
}
|
||||||
|
r.SetAnnotations(annotations)
|
||||||
|
|
||||||
|
// update the resource value with the transformed object
|
||||||
|
res.ResetPrimaryData(r)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// UpdateResourceOptions updates the generator options for each resource in the
|
||||||
|
// given ResMap based on plugin provided annotations.
|
||||||
|
func UpdateResourceOptions(rm resmap.ResMap) (resmap.ResMap, error) {
|
||||||
|
for _, r := range rm.Resources() {
|
||||||
|
// Disable name hashing by default and require plugin to explicitly
|
||||||
|
// request it for each resource.
|
||||||
|
annotations := r.GetAnnotations()
|
||||||
|
behavior := annotations[BehaviorAnnotation]
|
||||||
|
var needsHash bool
|
||||||
|
if val, ok := annotations[HashAnnotation]; ok {
|
||||||
|
b, err := strconv.ParseBool(val)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf(
|
||||||
|
"the annotation %q contains an invalid value (%q)",
|
||||||
|
HashAnnotation, val)
|
||||||
|
}
|
||||||
|
needsHash = b
|
||||||
|
}
|
||||||
|
delete(annotations, HashAnnotation)
|
||||||
|
delete(annotations, BehaviorAnnotation)
|
||||||
|
if len(annotations) == 0 {
|
||||||
|
annotations = nil
|
||||||
|
}
|
||||||
|
r.SetAnnotations(annotations)
|
||||||
|
r.SetOptions(types.NewGenArgs(
|
||||||
|
&types.GeneratorArgs{
|
||||||
|
Behavior: behavior,
|
||||||
|
Options: &types.GeneratorOptions{DisableNameSuffixHash: !needsHash}}))
|
||||||
|
}
|
||||||
|
return rm, nil
|
||||||
|
}
|
||||||
|
|||||||
@@ -4,12 +4,17 @@
|
|||||||
package utils
|
package utils
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"sigs.k8s.io/kustomize/api/filesys"
|
"sigs.k8s.io/kustomize/api/filesys"
|
||||||
|
"sigs.k8s.io/kustomize/api/k8sdeps/kunstruct"
|
||||||
"sigs.k8s.io/kustomize/api/konfig"
|
"sigs.k8s.io/kustomize/api/konfig"
|
||||||
|
"sigs.k8s.io/kustomize/api/resmap"
|
||||||
|
"sigs.k8s.io/kustomize/api/resource"
|
||||||
|
"sigs.k8s.io/kustomize/api/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestDeterminePluginSrcRoot(t *testing.T) {
|
func TestDeterminePluginSrcRoot(t *testing.T) {
|
||||||
@@ -24,3 +29,99 @@ func TestDeterminePluginSrcRoot(t *testing.T) {
|
|||||||
t.Errorf("expected suffix '%s' in '%s'", konfig.RelPluginHome, actual)
|
t.Errorf("expected suffix '%s' in '%s'", konfig.RelPluginHome, actual)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func makeConfigMap(rf *resource.Factory, name, behavior string, hashValue *string) *resource.Resource {
|
||||||
|
r := rf.FromMap(map[string]interface{}{
|
||||||
|
"apiVersion": "v1",
|
||||||
|
"kind": "ConfigMap",
|
||||||
|
"metadata": map[string]interface{}{"name": name},
|
||||||
|
})
|
||||||
|
annotations := map[string]string{}
|
||||||
|
if behavior != "" {
|
||||||
|
annotations[BehaviorAnnotation] = behavior
|
||||||
|
}
|
||||||
|
if hashValue != nil {
|
||||||
|
annotations[HashAnnotation] = *hashValue
|
||||||
|
}
|
||||||
|
if len(annotations) > 0 {
|
||||||
|
r.SetAnnotations(annotations)
|
||||||
|
}
|
||||||
|
return r
|
||||||
|
}
|
||||||
|
|
||||||
|
func makeConfigMapOptions(rf *resource.Factory, name, behavior string, disableHash bool) *resource.Resource {
|
||||||
|
return rf.FromMapAndOption(map[string]interface{}{
|
||||||
|
"apiVersion": "v1",
|
||||||
|
"kind": "ConfigMap",
|
||||||
|
"metadata": map[string]interface{}{"name": name},
|
||||||
|
}, &types.GeneratorArgs{
|
||||||
|
Behavior: behavior,
|
||||||
|
Options: &types.GeneratorOptions{DisableNameSuffixHash: disableHash}})
|
||||||
|
}
|
||||||
|
|
||||||
|
func strptr(s string) *string {
|
||||||
|
return &s
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestUpdateResourceOptions(t *testing.T) {
|
||||||
|
rf := resource.NewFactory(kunstruct.NewKunstructuredFactoryImpl())
|
||||||
|
in := resmap.New()
|
||||||
|
expected := resmap.New()
|
||||||
|
cases := []struct {
|
||||||
|
behavior string
|
||||||
|
needsHash bool
|
||||||
|
hashValue *string
|
||||||
|
}{
|
||||||
|
{hashValue: strptr("false")},
|
||||||
|
{hashValue: strptr("true"), needsHash: true},
|
||||||
|
{behavior: "replace"},
|
||||||
|
{behavior: "merge"},
|
||||||
|
{behavior: "create"},
|
||||||
|
{behavior: "nonsense"},
|
||||||
|
{behavior: "merge", hashValue: strptr("false")},
|
||||||
|
{behavior: "merge", hashValue: strptr("true"), needsHash: true},
|
||||||
|
}
|
||||||
|
for i, c := range cases {
|
||||||
|
name := fmt.Sprintf("test%d", i)
|
||||||
|
in.Append(makeConfigMap(rf, name, c.behavior, c.hashValue))
|
||||||
|
expected.Append(makeConfigMapOptions(rf, name, c.behavior, !c.needsHash))
|
||||||
|
}
|
||||||
|
actual, err := UpdateResourceOptions(in)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("unexpected error: %v", err.Error())
|
||||||
|
}
|
||||||
|
for i, a := range expected.Resources() {
|
||||||
|
b := actual.GetByIndex(i)
|
||||||
|
if b == nil {
|
||||||
|
t.Fatalf("resource %d missing from processed map", i)
|
||||||
|
}
|
||||||
|
if !a.Equals(b) {
|
||||||
|
t.Errorf("expected %v got %v", a, b)
|
||||||
|
}
|
||||||
|
if a.NeedHashSuffix() != b.NeedHashSuffix() {
|
||||||
|
t.Errorf("")
|
||||||
|
}
|
||||||
|
if a.Behavior() != b.Behavior() {
|
||||||
|
t.Errorf("expected %v got %v", a.Behavior(), b.Behavior())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestUpdateResourceOptionsWithInvalidHashAnnotationValues(t *testing.T) {
|
||||||
|
rf := resource.NewFactory(kunstruct.NewKunstructuredFactoryImpl())
|
||||||
|
cases := []string{
|
||||||
|
"",
|
||||||
|
"FaLsE",
|
||||||
|
"TrUe",
|
||||||
|
"potato",
|
||||||
|
}
|
||||||
|
for i, c := range cases {
|
||||||
|
name := fmt.Sprintf("test%d", i)
|
||||||
|
in := resmap.New()
|
||||||
|
in.Append(makeConfigMap(rf, name, "", &c))
|
||||||
|
_, err := UpdateResourceOptions(in)
|
||||||
|
if err == nil {
|
||||||
|
t.Errorf("expected error from value %q", c)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -209,6 +209,10 @@ func (kt *KustTarget) accumulateTarget(ra *accumulator.ResAccumulator) (
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
err = kt.runValidators(ra)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
err = ra.MergeVars(kt.kustomization.Vars)
|
err = ra.MergeVars(kt.kustomization.Vars)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrapf(
|
return nil, errors.Wrapf(
|
||||||
@@ -260,7 +264,7 @@ func (kt *KustTarget) runTransformers(ra *accumulator.ResAccumulator) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
r = append(r, lts...)
|
r = append(r, lts...)
|
||||||
lts, err = kt.configureExternalTransformers()
|
lts, err = kt.configureExternalTransformers(kt.kustomization.Transformers)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -269,15 +273,54 @@ func (kt *KustTarget) runTransformers(ra *accumulator.ResAccumulator) error {
|
|||||||
return ra.Transform(t)
|
return ra.Transform(t)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (kt *KustTarget) configureExternalTransformers() ([]resmap.Transformer, error) {
|
func (kt *KustTarget) configureExternalTransformers(transformers []string) ([]resmap.Transformer, error) {
|
||||||
ra := accumulator.MakeEmptyAccumulator()
|
ra := accumulator.MakeEmptyAccumulator()
|
||||||
ra, err := kt.accumulateResources(ra, kt.kustomization.Transformers)
|
ra, err := kt.accumulateResources(ra, transformers)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return kt.pLdr.LoadTransformers(kt.ldr, kt.validator, ra.ResMap())
|
return kt.pLdr.LoadTransformers(kt.ldr, kt.validator, ra.ResMap())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (kt *KustTarget) runValidators(ra *accumulator.ResAccumulator) error {
|
||||||
|
validators, err := kt.configureExternalTransformers(kt.kustomization.Validators)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
for _, v := range validators {
|
||||||
|
// Validators shouldn't modify the resource map
|
||||||
|
orignal := ra.ResMap().DeepCopy()
|
||||||
|
err = v.Transform(ra.ResMap())
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
new := ra.ResMap().DeepCopy()
|
||||||
|
kt.removeValidatedByLabel(new)
|
||||||
|
if err = orignal.ErrorIfNotEqualSets(new); err != nil {
|
||||||
|
return fmt.Errorf("validator shouldn't modify the resource map: %v", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (kt *KustTarget) removeValidatedByLabel(rm resmap.ResMap) {
|
||||||
|
|
||||||
|
resources := rm.Resources()
|
||||||
|
for _, r := range resources {
|
||||||
|
labels := r.GetLabels()
|
||||||
|
if _, found := labels[konfig.ValidatedByLabelKey]; !found {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
delete(labels, konfig.ValidatedByLabelKey)
|
||||||
|
if len(labels) == 0 {
|
||||||
|
r.SetLabels(nil)
|
||||||
|
} else {
|
||||||
|
r.SetLabels(labels)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// accumulateResources fills the given resourceAccumulator
|
// accumulateResources fills the given resourceAccumulator
|
||||||
// with resources read from the given list of paths.
|
// with resources read from the given list of paths.
|
||||||
func (kt *KustTarget) accumulateResources(
|
func (kt *KustTarget) accumulateResources(
|
||||||
|
|||||||
@@ -252,6 +252,10 @@ nameReference:
|
|||||||
kind: Role
|
kind: Role
|
||||||
- path: rules/resourceNames
|
- path: rules/resourceNames
|
||||||
kind: ClusterRole
|
kind: ClusterRole
|
||||||
|
- path: spec/template/spec/containers/env/valueFrom/secretKeyRef/name
|
||||||
|
kind: Service
|
||||||
|
group: serving.knative.dev
|
||||||
|
version: v1
|
||||||
|
|
||||||
- kind: Service
|
- kind: Service
|
||||||
version: v1
|
version: v1
|
||||||
|
|||||||
@@ -36,4 +36,7 @@ const (
|
|||||||
|
|
||||||
// An environment variable to turn on/off adding the ManagedByLabelKey
|
// An environment variable to turn on/off adding the ManagedByLabelKey
|
||||||
EnableManagedbyLabelEnv = "KUSTOMIZE_ENABLE_MANAGEDBY_LABEL"
|
EnableManagedbyLabelEnv = "KUSTOMIZE_ENABLE_MANAGEDBY_LABEL"
|
||||||
|
|
||||||
|
// Label key that indicates the resources are validated by a validator
|
||||||
|
ValidatedByLabelKey = "validated-by"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -225,13 +225,13 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- env:
|
- env:
|
||||||
|
- name: foo
|
||||||
|
value: bar
|
||||||
- name: FOO
|
- name: FOO
|
||||||
valueFrom:
|
valueFrom:
|
||||||
configMapKeyRef:
|
configMapKeyRef:
|
||||||
key: somekey
|
key: somekey
|
||||||
name: test-infra-app-env-ffmd9b969m
|
name: test-infra-app-env-ffmd9b969m
|
||||||
- name: foo
|
|
||||||
value: bar
|
|
||||||
image: nginx:1.8.0
|
image: nginx:1.8.0
|
||||||
name: nginx
|
name: nginx
|
||||||
ports:
|
ports:
|
||||||
@@ -292,8 +292,7 @@ metadata:
|
|||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
data:
|
data:
|
||||||
nonsense: "Lorem ipsum dolor sit amet, consectetur\nadipiscing elit, sed do eiusmod
|
nonsense: "Lorem ipsum dolor sit amet, consectetur\nadipiscing elit, sed do eiusmod tempor\nincididunt ut labore et dolore magna aliqua. \n"
|
||||||
tempor\nincididunt ut labore et dolore magna aliqua. \n"
|
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
|
|||||||
@@ -132,6 +132,54 @@ spec:
|
|||||||
`)
|
`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestTinyOverlay(t *testing.T) {
|
||||||
|
th := kusttest_test.MakeHarness(t)
|
||||||
|
th.WriteK("base", `
|
||||||
|
namePrefix: a-
|
||||||
|
resources:
|
||||||
|
- deployment.yaml
|
||||||
|
`)
|
||||||
|
th.WriteF("base/deployment.yaml", `
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: myDeployment
|
||||||
|
spec:
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- image: whatever
|
||||||
|
`)
|
||||||
|
th.WriteK("overlay", `
|
||||||
|
namePrefix: b-
|
||||||
|
resources:
|
||||||
|
- ../base
|
||||||
|
patchesStrategicMerge:
|
||||||
|
- depPatch.yaml
|
||||||
|
`)
|
||||||
|
th.WriteF("overlay/depPatch.yaml", `
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: myDeployment
|
||||||
|
spec:
|
||||||
|
replicas: 999
|
||||||
|
`)
|
||||||
|
m := th.Run("overlay", th.MakeDefaultOptions())
|
||||||
|
th.AssertActualEqualsExpected(m, `
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: b-a-myDeployment
|
||||||
|
spec:
|
||||||
|
replicas: 999
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- image: whatever
|
||||||
|
`)
|
||||||
|
}
|
||||||
|
|
||||||
func writeSmallBase(th kusttest_test.Harness) {
|
func writeSmallBase(th kusttest_test.Harness) {
|
||||||
th.WriteK("/app/base", `
|
th.WriteK("/app/base", `
|
||||||
namePrefix: a-
|
namePrefix: a-
|
||||||
|
|||||||
@@ -85,8 +85,7 @@ metadata:
|
|||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
data:
|
data:
|
||||||
druid_segmentCache_locations: '[{"path": "var/druid/segment-cache", "maxSize":
|
druid_segmentCache_locations: '[{"path": "var/druid/segment-cache", "maxSize": 32000000000, "freeSpacePercent": 1.0}]'
|
||||||
32000000000, "freeSpacePercent": 1.0}]'
|
|
||||||
v2: '[{"path": "var/druid/segment-cache"}]'
|
v2: '[{"path": "var/druid/segment-cache"}]'
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
metadata:
|
metadata:
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ spec:
|
|||||||
location: SW
|
location: SW
|
||||||
`)
|
`)
|
||||||
th.WriteF("/app/base/animalPark.yaml", `
|
th.WriteF("/app/base/animalPark.yaml", `
|
||||||
|
apiVersion: foo
|
||||||
kind: AnimalPark
|
kind: AnimalPark
|
||||||
metadata:
|
metadata:
|
||||||
name: sandiego
|
name: sandiego
|
||||||
@@ -93,6 +94,7 @@ varReference:
|
|||||||
`)
|
`)
|
||||||
m := th.Run("/app/base", th.MakeDefaultOptions())
|
m := th.Run("/app/base", th.MakeDefaultOptions())
|
||||||
th.AssertActualEqualsExpected(m, `
|
th.AssertActualEqualsExpected(m, `
|
||||||
|
apiVersion: foo
|
||||||
kind: AnimalPark
|
kind: AnimalPark
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
@@ -161,6 +163,7 @@ varReference:
|
|||||||
`)
|
`)
|
||||||
m := th.Run("/app/base", th.MakeDefaultOptions())
|
m := th.Run("/app/base", th.MakeDefaultOptions())
|
||||||
th.AssertActualEqualsExpected(m, `
|
th.AssertActualEqualsExpected(m, `
|
||||||
|
apiVersion: foo
|
||||||
kind: AnimalPark
|
kind: AnimalPark
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
@@ -212,14 +215,17 @@ func TestFixedBug605_BaseCustomizationAvailableInOverlay(t *testing.T) {
|
|||||||
nameReference:
|
nameReference:
|
||||||
- kind: Gorilla
|
- kind: Gorilla
|
||||||
fieldSpecs:
|
fieldSpecs:
|
||||||
- kind: AnimalPark
|
- apiVersion: foo
|
||||||
|
kind: AnimalPark
|
||||||
path: spec/gorillaRef/name
|
path: spec/gorillaRef/name
|
||||||
- kind: Giraffe
|
- kind: Giraffe
|
||||||
fieldSpecs:
|
fieldSpecs:
|
||||||
- kind: AnimalPark
|
- apiVersion: foo
|
||||||
|
kind: AnimalPark
|
||||||
path: spec/giraffeRef/name
|
path: spec/giraffeRef/name
|
||||||
varReference:
|
varReference:
|
||||||
- path: spec/food
|
- path: spec/food
|
||||||
|
apiVersion: foo
|
||||||
kind: AnimalPark
|
kind: AnimalPark
|
||||||
`)
|
`)
|
||||||
th.WriteK("/app/overlay", `
|
th.WriteK("/app/overlay", `
|
||||||
@@ -242,6 +248,7 @@ spec:
|
|||||||
`)
|
`)
|
||||||
// The following replaces the gorillaRef in the AnimalPark.
|
// The following replaces the gorillaRef in the AnimalPark.
|
||||||
th.WriteF("/app/overlay/animalPark.yaml", `
|
th.WriteF("/app/overlay/animalPark.yaml", `
|
||||||
|
apiVersion: foo
|
||||||
kind: AnimalPark
|
kind: AnimalPark
|
||||||
metadata:
|
metadata:
|
||||||
name: sandiego
|
name: sandiego
|
||||||
@@ -251,6 +258,7 @@ spec:
|
|||||||
`)
|
`)
|
||||||
m := th.Run("/app/overlay", th.MakeDefaultOptions())
|
m := th.Run("/app/overlay", th.MakeDefaultOptions())
|
||||||
th.AssertActualEqualsExpected(m, `
|
th.AssertActualEqualsExpected(m, `
|
||||||
|
apiVersion: foo
|
||||||
kind: AnimalPark
|
kind: AnimalPark
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
|
|
||||||
func makeCommonFileForExtendedPatchTest(th kusttest_test.Harness) {
|
func makeCommonFileForExtendedPatchTest(th kusttest_test.Harness) {
|
||||||
th.WriteF("/app/base/deployment.yaml", `
|
th.WriteF("/app/base/deployment.yaml", `
|
||||||
apiVersion: apps/v1beta2
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: nginx
|
name: nginx
|
||||||
@@ -36,7 +36,7 @@ spec:
|
|||||||
name: configmap-in-base
|
name: configmap-in-base
|
||||||
name: configmap-in-base
|
name: configmap-in-base
|
||||||
---
|
---
|
||||||
apiVersion: apps/v1beta2
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: busybox
|
name: busybox
|
||||||
@@ -101,7 +101,7 @@ patches:
|
|||||||
name: busybox
|
name: busybox
|
||||||
`)
|
`)
|
||||||
th.WriteF("/app/base/patch.yaml", `
|
th.WriteF("/app/base/patch.yaml", `
|
||||||
apiVersion: apps/v1beta2
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: busybox
|
name: busybox
|
||||||
@@ -110,7 +110,7 @@ metadata:
|
|||||||
`)
|
`)
|
||||||
m := th.Run("/app/base", th.MakeDefaultOptions())
|
m := th.Run("/app/base", th.MakeDefaultOptions())
|
||||||
th.AssertActualEqualsExpected(m, `
|
th.AssertActualEqualsExpected(m, `
|
||||||
apiVersion: apps/v1beta2
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
@@ -135,7 +135,7 @@ spec:
|
|||||||
name: configmap-in-base
|
name: configmap-in-base
|
||||||
name: configmap-in-base
|
name: configmap-in-base
|
||||||
---
|
---
|
||||||
apiVersion: apps/v1beta2
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
@@ -156,8 +156,7 @@ spec:
|
|||||||
- mountPath: /tmp/ps
|
- mountPath: /tmp/ps
|
||||||
name: busybox-persistent-storage
|
name: busybox-persistent-storage
|
||||||
volumes:
|
volumes:
|
||||||
- emptyDir: {}
|
- name: busybox-persistent-storage
|
||||||
name: busybox-persistent-storage
|
|
||||||
- configMap:
|
- configMap:
|
||||||
name: configmap-in-base
|
name: configmap-in-base
|
||||||
name: configmap-in-base
|
name: configmap-in-base
|
||||||
@@ -203,7 +202,7 @@ patches:
|
|||||||
kind: Deployment
|
kind: Deployment
|
||||||
`)
|
`)
|
||||||
th.WriteF("/app/base/patch.yaml", `
|
th.WriteF("/app/base/patch.yaml", `
|
||||||
apiVersion: apps/v1beta2
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: busybox
|
name: busybox
|
||||||
@@ -212,7 +211,7 @@ metadata:
|
|||||||
`)
|
`)
|
||||||
m := th.Run("/app/base", th.MakeDefaultOptions())
|
m := th.Run("/app/base", th.MakeDefaultOptions())
|
||||||
th.AssertActualEqualsExpected(m, `
|
th.AssertActualEqualsExpected(m, `
|
||||||
apiVersion: apps/v1beta2
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
@@ -233,13 +232,12 @@ spec:
|
|||||||
- mountPath: /tmp/ps
|
- mountPath: /tmp/ps
|
||||||
name: nginx-persistent-storage
|
name: nginx-persistent-storage
|
||||||
volumes:
|
volumes:
|
||||||
- emptyDir: {}
|
- name: nginx-persistent-storage
|
||||||
name: nginx-persistent-storage
|
|
||||||
- configMap:
|
- configMap:
|
||||||
name: configmap-in-base
|
name: configmap-in-base
|
||||||
name: configmap-in-base
|
name: configmap-in-base
|
||||||
---
|
---
|
||||||
apiVersion: apps/v1beta2
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
@@ -260,8 +258,7 @@ spec:
|
|||||||
- mountPath: /tmp/ps
|
- mountPath: /tmp/ps
|
||||||
name: busybox-persistent-storage
|
name: busybox-persistent-storage
|
||||||
volumes:
|
volumes:
|
||||||
- emptyDir: {}
|
- name: busybox-persistent-storage
|
||||||
name: busybox-persistent-storage
|
|
||||||
- configMap:
|
- configMap:
|
||||||
name: configmap-in-base
|
name: configmap-in-base
|
||||||
name: configmap-in-base
|
name: configmap-in-base
|
||||||
@@ -305,7 +302,7 @@ patches:
|
|||||||
labelSelector: app=nginx
|
labelSelector: app=nginx
|
||||||
`)
|
`)
|
||||||
th.WriteF("/app/base/patch.yaml", `
|
th.WriteF("/app/base/patch.yaml", `
|
||||||
apiVersion: apps/v1beta2
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: nginx
|
name: nginx
|
||||||
@@ -314,7 +311,7 @@ metadata:
|
|||||||
`)
|
`)
|
||||||
m := th.Run("/app/base", th.MakeDefaultOptions())
|
m := th.Run("/app/base", th.MakeDefaultOptions())
|
||||||
th.AssertActualEqualsExpected(m, `
|
th.AssertActualEqualsExpected(m, `
|
||||||
apiVersion: apps/v1beta2
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
@@ -335,13 +332,12 @@ spec:
|
|||||||
- mountPath: /tmp/ps
|
- mountPath: /tmp/ps
|
||||||
name: nginx-persistent-storage
|
name: nginx-persistent-storage
|
||||||
volumes:
|
volumes:
|
||||||
- emptyDir: {}
|
- name: nginx-persistent-storage
|
||||||
name: nginx-persistent-storage
|
|
||||||
- configMap:
|
- configMap:
|
||||||
name: configmap-in-base
|
name: configmap-in-base
|
||||||
name: configmap-in-base
|
name: configmap-in-base
|
||||||
---
|
---
|
||||||
apiVersion: apps/v1beta2
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
@@ -408,7 +404,7 @@ patches:
|
|||||||
kind: Deployment
|
kind: Deployment
|
||||||
`)
|
`)
|
||||||
th.WriteF("/app/base/patch.yaml", `
|
th.WriteF("/app/base/patch.yaml", `
|
||||||
apiVersion: apps/v1beta2
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: busybox
|
name: busybox
|
||||||
@@ -417,7 +413,7 @@ metadata:
|
|||||||
`)
|
`)
|
||||||
m := th.Run("/app/base", th.MakeDefaultOptions())
|
m := th.Run("/app/base", th.MakeDefaultOptions())
|
||||||
th.AssertActualEqualsExpected(m, `
|
th.AssertActualEqualsExpected(m, `
|
||||||
apiVersion: apps/v1beta2
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
@@ -442,7 +438,7 @@ spec:
|
|||||||
name: configmap-in-base
|
name: configmap-in-base
|
||||||
name: configmap-in-base
|
name: configmap-in-base
|
||||||
---
|
---
|
||||||
apiVersion: apps/v1beta2
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
@@ -463,8 +459,7 @@ spec:
|
|||||||
- mountPath: /tmp/ps
|
- mountPath: /tmp/ps
|
||||||
name: busybox-persistent-storage
|
name: busybox-persistent-storage
|
||||||
volumes:
|
volumes:
|
||||||
- emptyDir: {}
|
- name: busybox-persistent-storage
|
||||||
name: busybox-persistent-storage
|
|
||||||
- configMap:
|
- configMap:
|
||||||
name: configmap-in-base
|
name: configmap-in-base
|
||||||
name: configmap-in-base
|
name: configmap-in-base
|
||||||
@@ -509,7 +504,7 @@ patches:
|
|||||||
labelSelector: app=busybox
|
labelSelector: app=busybox
|
||||||
`)
|
`)
|
||||||
th.WriteF("/app/base/patch.yaml", `
|
th.WriteF("/app/base/patch.yaml", `
|
||||||
apiVersion: apps/v1beta2
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: busybox
|
name: busybox
|
||||||
@@ -518,7 +513,7 @@ metadata:
|
|||||||
`)
|
`)
|
||||||
m := th.Run("/app/base", th.MakeDefaultOptions())
|
m := th.Run("/app/base", th.MakeDefaultOptions())
|
||||||
th.AssertActualEqualsExpected(m, `
|
th.AssertActualEqualsExpected(m, `
|
||||||
apiVersion: apps/v1beta2
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
@@ -543,7 +538,7 @@ spec:
|
|||||||
name: configmap-in-base
|
name: configmap-in-base
|
||||||
name: configmap-in-base
|
name: configmap-in-base
|
||||||
---
|
---
|
||||||
apiVersion: apps/v1beta2
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
@@ -564,8 +559,7 @@ spec:
|
|||||||
- mountPath: /tmp/ps
|
- mountPath: /tmp/ps
|
||||||
name: busybox-persistent-storage
|
name: busybox-persistent-storage
|
||||||
volumes:
|
volumes:
|
||||||
- emptyDir: {}
|
- name: busybox-persistent-storage
|
||||||
name: busybox-persistent-storage
|
|
||||||
- configMap:
|
- configMap:
|
||||||
name: configmap-in-base
|
name: configmap-in-base
|
||||||
name: configmap-in-base
|
name: configmap-in-base
|
||||||
@@ -612,7 +606,7 @@ patches:
|
|||||||
labelSelector: app=busybox
|
labelSelector: app=busybox
|
||||||
`)
|
`)
|
||||||
th.WriteF("/app/base/patch.yaml", `
|
th.WriteF("/app/base/patch.yaml", `
|
||||||
apiVersion: apps/v1beta2
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: busybox
|
name: busybox
|
||||||
@@ -621,7 +615,7 @@ metadata:
|
|||||||
`)
|
`)
|
||||||
m := th.Run("/app/base", th.MakeDefaultOptions())
|
m := th.Run("/app/base", th.MakeDefaultOptions())
|
||||||
th.AssertActualEqualsExpected(m, `
|
th.AssertActualEqualsExpected(m, `
|
||||||
apiVersion: apps/v1beta2
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
@@ -646,7 +640,7 @@ spec:
|
|||||||
name: configmap-in-base
|
name: configmap-in-base
|
||||||
name: configmap-in-base
|
name: configmap-in-base
|
||||||
---
|
---
|
||||||
apiVersion: apps/v1beta2
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
@@ -667,8 +661,7 @@ spec:
|
|||||||
- mountPath: /tmp/ps
|
- mountPath: /tmp/ps
|
||||||
name: busybox-persistent-storage
|
name: busybox-persistent-storage
|
||||||
volumes:
|
volumes:
|
||||||
- emptyDir: {}
|
- name: busybox-persistent-storage
|
||||||
name: busybox-persistent-storage
|
|
||||||
- configMap:
|
- configMap:
|
||||||
name: configmap-in-base
|
name: configmap-in-base
|
||||||
name: configmap-in-base
|
name: configmap-in-base
|
||||||
@@ -714,7 +707,7 @@ patches:
|
|||||||
labelSelector: app=busybox
|
labelSelector: app=busybox
|
||||||
`)
|
`)
|
||||||
th.WriteF("/app/base/patch.yaml", `
|
th.WriteF("/app/base/patch.yaml", `
|
||||||
apiVersion: apps/v1beta2
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: busybox
|
name: busybox
|
||||||
@@ -723,7 +716,7 @@ metadata:
|
|||||||
`)
|
`)
|
||||||
m := th.Run("/app/base", th.MakeDefaultOptions())
|
m := th.Run("/app/base", th.MakeDefaultOptions())
|
||||||
th.AssertActualEqualsExpected(m, `
|
th.AssertActualEqualsExpected(m, `
|
||||||
apiVersion: apps/v1beta2
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
@@ -748,7 +741,7 @@ spec:
|
|||||||
name: configmap-in-base
|
name: configmap-in-base
|
||||||
name: configmap-in-base
|
name: configmap-in-base
|
||||||
---
|
---
|
||||||
apiVersion: apps/v1beta2
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
@@ -769,8 +762,7 @@ spec:
|
|||||||
- mountPath: /tmp/ps
|
- mountPath: /tmp/ps
|
||||||
name: busybox-persistent-storage
|
name: busybox-persistent-storage
|
||||||
volumes:
|
volumes:
|
||||||
- emptyDir: {}
|
- name: busybox-persistent-storage
|
||||||
name: busybox-persistent-storage
|
|
||||||
- configMap:
|
- configMap:
|
||||||
name: configmap-in-base
|
name: configmap-in-base
|
||||||
name: configmap-in-base
|
name: configmap-in-base
|
||||||
@@ -814,7 +806,7 @@ patches:
|
|||||||
name: no-match
|
name: no-match
|
||||||
`)
|
`)
|
||||||
th.WriteF("/app/base/patch.yaml", `
|
th.WriteF("/app/base/patch.yaml", `
|
||||||
apiVersion: apps/v1beta2
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: busybox
|
name: busybox
|
||||||
@@ -823,7 +815,7 @@ metadata:
|
|||||||
`)
|
`)
|
||||||
m := th.Run("/app/base", th.MakeDefaultOptions())
|
m := th.Run("/app/base", th.MakeDefaultOptions())
|
||||||
th.AssertActualEqualsExpected(m, `
|
th.AssertActualEqualsExpected(m, `
|
||||||
apiVersion: apps/v1beta2
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
@@ -848,7 +840,7 @@ spec:
|
|||||||
name: configmap-in-base
|
name: configmap-in-base
|
||||||
name: configmap-in-base
|
name: configmap-in-base
|
||||||
---
|
---
|
||||||
apiVersion: apps/v1beta2
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
@@ -910,7 +902,7 @@ patches:
|
|||||||
- path: patch.yaml
|
- path: patch.yaml
|
||||||
`)
|
`)
|
||||||
th.WriteF("/app/base/patch.yaml", `
|
th.WriteF("/app/base/patch.yaml", `
|
||||||
apiVersion: apps/v1beta2
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: busybox
|
name: busybox
|
||||||
@@ -919,7 +911,7 @@ metadata:
|
|||||||
`)
|
`)
|
||||||
m := th.Run("/app/base", th.MakeDefaultOptions())
|
m := th.Run("/app/base", th.MakeDefaultOptions())
|
||||||
th.AssertActualEqualsExpected(m, `
|
th.AssertActualEqualsExpected(m, `
|
||||||
apiVersion: apps/v1beta2
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
@@ -944,7 +936,7 @@ spec:
|
|||||||
name: configmap-in-base
|
name: configmap-in-base
|
||||||
name: configmap-in-base
|
name: configmap-in-base
|
||||||
---
|
---
|
||||||
apiVersion: apps/v1beta2
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
@@ -965,8 +957,7 @@ spec:
|
|||||||
- mountPath: /tmp/ps
|
- mountPath: /tmp/ps
|
||||||
name: busybox-persistent-storage
|
name: busybox-persistent-storage
|
||||||
volumes:
|
volumes:
|
||||||
- emptyDir: {}
|
- name: busybox-persistent-storage
|
||||||
name: busybox-persistent-storage
|
|
||||||
- configMap:
|
- configMap:
|
||||||
name: configmap-in-base
|
name: configmap-in-base
|
||||||
name: configmap-in-base
|
name: configmap-in-base
|
||||||
@@ -1014,7 +1005,7 @@ patches:
|
|||||||
kind: Job
|
kind: Job
|
||||||
`)
|
`)
|
||||||
th.WriteF("/app/base/patch.yaml", `
|
th.WriteF("/app/base/patch.yaml", `
|
||||||
apiVersion: apps/v1beta2
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: busybox
|
name: busybox
|
||||||
@@ -1023,7 +1014,7 @@ metadata:
|
|||||||
`)
|
`)
|
||||||
m := th.Run("/app/base", th.MakeDefaultOptions())
|
m := th.Run("/app/base", th.MakeDefaultOptions())
|
||||||
th.AssertActualEqualsExpected(m, `
|
th.AssertActualEqualsExpected(m, `
|
||||||
apiVersion: apps/v1beta2
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
@@ -1048,7 +1039,7 @@ spec:
|
|||||||
name: configmap-in-base
|
name: configmap-in-base
|
||||||
name: configmap-in-base
|
name: configmap-in-base
|
||||||
---
|
---
|
||||||
apiVersion: apps/v1beta2
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
@@ -1116,7 +1107,7 @@ patches:
|
|||||||
kind: Deployment
|
kind: Deployment
|
||||||
`)
|
`)
|
||||||
th.WriteF("/app/base/patch1.yaml", `
|
th.WriteF("/app/base/patch1.yaml", `
|
||||||
apiVersion: apps/v1beta2
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: busybox
|
name: busybox
|
||||||
@@ -1124,7 +1115,7 @@ metadata:
|
|||||||
new-key-from-patch1: new-value
|
new-key-from-patch1: new-value
|
||||||
`)
|
`)
|
||||||
th.WriteF("/app/base/patch2.yaml", `
|
th.WriteF("/app/base/patch2.yaml", `
|
||||||
apiVersion: apps/v1beta2
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: busybox
|
name: busybox
|
||||||
@@ -1133,7 +1124,7 @@ metadata:
|
|||||||
`)
|
`)
|
||||||
m := th.Run("/app/base", th.MakeDefaultOptions())
|
m := th.Run("/app/base", th.MakeDefaultOptions())
|
||||||
th.AssertActualEqualsExpected(m, `
|
th.AssertActualEqualsExpected(m, `
|
||||||
apiVersion: apps/v1beta2
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
@@ -1158,7 +1149,7 @@ spec:
|
|||||||
name: configmap-in-base
|
name: configmap-in-base
|
||||||
name: configmap-in-base
|
name: configmap-in-base
|
||||||
---
|
---
|
||||||
apiVersion: apps/v1beta2
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
@@ -1180,8 +1171,7 @@ spec:
|
|||||||
- mountPath: /tmp/ps
|
- mountPath: /tmp/ps
|
||||||
name: busybox-persistent-storage
|
name: busybox-persistent-storage
|
||||||
volumes:
|
volumes:
|
||||||
- emptyDir: {}
|
- name: busybox-persistent-storage
|
||||||
name: busybox-persistent-storage
|
|
||||||
- configMap:
|
- configMap:
|
||||||
name: configmap-in-base
|
name: configmap-in-base
|
||||||
name: configmap-in-base
|
name: configmap-in-base
|
||||||
|
|||||||
466
api/krusty/fnplugin_test.go
Normal file
466
api/krusty/fnplugin_test.go
Normal file
@@ -0,0 +1,466 @@
|
|||||||
|
package krusty_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"os/exec"
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
kusttest_test "sigs.k8s.io/kustomize/api/testutils/kusttest"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestFnExecGenerator(t *testing.T) {
|
||||||
|
th := kusttest_test.MakeEnhancedHarness(t)
|
||||||
|
defer th.Reset()
|
||||||
|
|
||||||
|
th.WriteK("/app", `
|
||||||
|
resources:
|
||||||
|
- short_secret.yaml
|
||||||
|
generators:
|
||||||
|
- gener.yaml
|
||||||
|
`)
|
||||||
|
|
||||||
|
// Create some additional resource just to make sure everything is added
|
||||||
|
th.WriteF("/app/short_secret.yaml", `
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
airshipit.org/ephemeral-user-data: "true"
|
||||||
|
name: node1-bmc-secret
|
||||||
|
type: Opaque
|
||||||
|
stringData:
|
||||||
|
userData: |
|
||||||
|
bootcmd:
|
||||||
|
- mkdir /mnt/vda
|
||||||
|
`)
|
||||||
|
|
||||||
|
th.WriteF("/app/gener.yaml", `
|
||||||
|
kind: executable
|
||||||
|
metadata:
|
||||||
|
name: demo
|
||||||
|
annotations:
|
||||||
|
config.kubernetes.io/function: |
|
||||||
|
exec:
|
||||||
|
path: ./fnplugin_test/fnexectest.sh
|
||||||
|
spec:
|
||||||
|
`)
|
||||||
|
o := th.MakeOptionsPluginsEnabled()
|
||||||
|
o.PluginConfig.FnpLoadingOptions.EnableExec = true
|
||||||
|
m := th.Run("/app", o)
|
||||||
|
th.AssertActualEqualsExpected(m, `
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
airshipit.org/ephemeral-user-data: "true"
|
||||||
|
name: node1-bmc-secret
|
||||||
|
stringData:
|
||||||
|
userData: |
|
||||||
|
bootcmd:
|
||||||
|
- mkdir /mnt/vda
|
||||||
|
type: Opaque
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
config.kubernetes.io/path: deployment_nginx.yaml
|
||||||
|
tshirt-size: small
|
||||||
|
labels:
|
||||||
|
app: nginx
|
||||||
|
name: nginx
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: nginx
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: nginx
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- image: nginx
|
||||||
|
name: nginx
|
||||||
|
`)
|
||||||
|
}
|
||||||
|
|
||||||
|
func skipIfNoDocker(t *testing.T) {
|
||||||
|
if _, err := exec.LookPath("docker"); err != nil {
|
||||||
|
t.Skip("skipping because docker binary wasn't found in PATH")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestFnContainerGenerator(t *testing.T) {
|
||||||
|
skipIfNoDocker(t)
|
||||||
|
|
||||||
|
th := kusttest_test.MakeEnhancedHarness(t)
|
||||||
|
defer th.Reset()
|
||||||
|
|
||||||
|
th.WriteK("/app", `
|
||||||
|
resources:
|
||||||
|
- short_secret.yaml
|
||||||
|
generators:
|
||||||
|
- gener.yaml
|
||||||
|
`)
|
||||||
|
// Create generator config
|
||||||
|
th.WriteF("/app/gener.yaml", `
|
||||||
|
apiVersion: examples.config.kubernetes.io/v1beta1
|
||||||
|
kind: CockroachDB
|
||||||
|
metadata:
|
||||||
|
name: demo
|
||||||
|
annotations:
|
||||||
|
config.kubernetes.io/function: |
|
||||||
|
container:
|
||||||
|
image: gcr.io/kustomize-functions/example-cockroachdb:v0.1.0
|
||||||
|
spec:
|
||||||
|
replicas: 3
|
||||||
|
`)
|
||||||
|
// Create some additional resource just to make sure everything is added
|
||||||
|
th.WriteF("/app/short_secret.yaml", `
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
airshipit.org/ephemeral-user-data: "true"
|
||||||
|
name: node1-bmc-secret
|
||||||
|
type: Opaque
|
||||||
|
stringData:
|
||||||
|
userData: |
|
||||||
|
bootcmd:
|
||||||
|
- mkdir /mnt/vda
|
||||||
|
`)
|
||||||
|
m := th.Run("/app", th.MakeOptionsPluginsEnabled())
|
||||||
|
th.AssertActualEqualsExpected(m, `
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
airshipit.org/ephemeral-user-data: "true"
|
||||||
|
name: node1-bmc-secret
|
||||||
|
stringData:
|
||||||
|
userData: |
|
||||||
|
bootcmd:
|
||||||
|
- mkdir /mnt/vda
|
||||||
|
type: Opaque
|
||||||
|
---
|
||||||
|
apiVersion: policy/v1beta1
|
||||||
|
kind: PodDisruptionBudget
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
config.kubernetes.io/path: config/demo-budget_poddisruptionbudget.yaml
|
||||||
|
labels:
|
||||||
|
app: cockroachdb
|
||||||
|
name: demo
|
||||||
|
name: demo-budget
|
||||||
|
spec:
|
||||||
|
minAvailable: 67%
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: cockroachdb
|
||||||
|
name: demo
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
config.kubernetes.io/path: config/demo-public_service.yaml
|
||||||
|
labels:
|
||||||
|
app: cockroachdb
|
||||||
|
name: demo
|
||||||
|
name: demo-public
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- name: grpc
|
||||||
|
port: 26257
|
||||||
|
targetPort: 26257
|
||||||
|
- name: http
|
||||||
|
port: 8080
|
||||||
|
targetPort: 8080
|
||||||
|
selector:
|
||||||
|
app: cockroachdb
|
||||||
|
name: demo
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
config.kubernetes.io/path: config/demo_service.yaml
|
||||||
|
prometheus.io/path: _status/vars
|
||||||
|
prometheus.io/port: "8080"
|
||||||
|
prometheus.io/scrape: "true"
|
||||||
|
service.alpha.kubernetes.io/tolerate-unready-endpoints: "true"
|
||||||
|
labels:
|
||||||
|
app: cockroachdb
|
||||||
|
name: demo
|
||||||
|
name: demo
|
||||||
|
spec:
|
||||||
|
clusterIP: None
|
||||||
|
ports:
|
||||||
|
- name: grpc
|
||||||
|
port: 26257
|
||||||
|
targetPort: 26257
|
||||||
|
- name: http
|
||||||
|
port: 8080
|
||||||
|
targetPort: 8080
|
||||||
|
selector:
|
||||||
|
app: cockroachdb
|
||||||
|
name: demo
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: StatefulSet
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
config.kubernetes.io/path: config/demo_statefulset.yaml
|
||||||
|
labels:
|
||||||
|
app: cockroachdb
|
||||||
|
name: demo
|
||||||
|
name: demo
|
||||||
|
spec:
|
||||||
|
replicas: 3
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: cockroachdb
|
||||||
|
name: demo
|
||||||
|
serviceName: demo
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: cockroachdb
|
||||||
|
name: demo
|
||||||
|
spec:
|
||||||
|
affinity:
|
||||||
|
podAntiAffinity:
|
||||||
|
preferredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
- podAffinityTerm:
|
||||||
|
labelSelector:
|
||||||
|
matchExpressions:
|
||||||
|
- key: app
|
||||||
|
operator: In
|
||||||
|
values:
|
||||||
|
- cockroachdb
|
||||||
|
topologyKey: kubernetes.io/hostname
|
||||||
|
weight: 100
|
||||||
|
containers:
|
||||||
|
- command:
|
||||||
|
- /bin/bash
|
||||||
|
- -ecx
|
||||||
|
- |
|
||||||
|
# The use of qualified `+"`hostname -f`"+` is crucial:
|
||||||
|
# Other nodes aren't able to look up the unqualified hostname.
|
||||||
|
CRARGS=("start" "--logtostderr" "--insecure" "--host" "$(hostname -f)" "--http-host" "0.0.0.0")
|
||||||
|
# We only want to initialize a new cluster (by omitting the join flag)
|
||||||
|
# if we're sure that we're the first node (i.e. index 0) and that
|
||||||
|
# there aren't any other nodes running as part of the cluster that
|
||||||
|
# this is supposed to be a part of (which indicates that a cluster
|
||||||
|
# already exists and we should make sure not to create a new one).
|
||||||
|
# It's fine to run without --join on a restart if there aren't any
|
||||||
|
# other nodes.
|
||||||
|
if [ ! "$(hostname)" == "cockroachdb-0" ] || [ -e "/cockroach/cockroach-data/cluster_exists_marker" ]
|
||||||
|
then
|
||||||
|
# We don't join cockroachdb in order to avoid a node attempting
|
||||||
|
# to join itself, which currently doesn't work
|
||||||
|
# (https://github.com/cockroachdb/cockroach/issues/9625).
|
||||||
|
CRARGS+=("--join" "cockroachdb-public")
|
||||||
|
fi
|
||||||
|
exec /cockroach/cockroach ${CRARGS[*]}
|
||||||
|
image: cockroachdb/cockroach:v1.1.0
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
name: demo
|
||||||
|
ports:
|
||||||
|
- containerPort: 26257
|
||||||
|
name: grpc
|
||||||
|
- containerPort: 8080
|
||||||
|
name: http
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: /cockroach/cockroach-data
|
||||||
|
name: datadir
|
||||||
|
initContainers:
|
||||||
|
- args:
|
||||||
|
- -on-start=/on-start.sh
|
||||||
|
- -service=cockroachdb
|
||||||
|
env:
|
||||||
|
- name: POD_NAMESPACE
|
||||||
|
valueFrom:
|
||||||
|
fieldRef:
|
||||||
|
fieldPath: metadata.namespace
|
||||||
|
image: cockroachdb/cockroach-k8s-init:0.1
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
name: bootstrap
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: /cockroach/cockroach-data
|
||||||
|
name: datadir
|
||||||
|
terminationGracePeriodSeconds: 60
|
||||||
|
volumes:
|
||||||
|
- name: datadir
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: datadir
|
||||||
|
volumeClaimTemplates:
|
||||||
|
- metadata:
|
||||||
|
name: datadir
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 1Gi
|
||||||
|
`)
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestFnContainerTransformer(t *testing.T) {
|
||||||
|
skipIfNoDocker(t)
|
||||||
|
|
||||||
|
th := kusttest_test.MakeEnhancedHarness(t)
|
||||||
|
defer th.Reset()
|
||||||
|
|
||||||
|
th.WriteK("/app", `
|
||||||
|
resources:
|
||||||
|
- data.yaml
|
||||||
|
transformers:
|
||||||
|
- transf1.yaml
|
||||||
|
- transf2.yaml
|
||||||
|
`)
|
||||||
|
|
||||||
|
th.WriteF("/app/data.yaml", `
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: nginx
|
||||||
|
labels:
|
||||||
|
app: nginx
|
||||||
|
annotations:
|
||||||
|
tshirt-size: small # this injects the resource reservations
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: nginx
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: nginx
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: nginx
|
||||||
|
image: nginx
|
||||||
|
`)
|
||||||
|
// This transformer should add resource reservations based on annotation in data.yaml
|
||||||
|
// See https://github.com/kubernetes-sigs/kustomize/tree/master/functions/examples/injection-tshirt-sizes
|
||||||
|
th.WriteF("/app/transf1.yaml", `
|
||||||
|
apiVersion: examples.config.kubernetes.io/v1beta1
|
||||||
|
kind: Validator
|
||||||
|
metadata:
|
||||||
|
name: valid
|
||||||
|
annotations:
|
||||||
|
config.kubernetes.io/function: |-
|
||||||
|
container:
|
||||||
|
image: gcr.io/kustomize-functions/example-tshirt:v0.2.0
|
||||||
|
`)
|
||||||
|
// This transformer will check resources without and won't do any changes
|
||||||
|
// See https://github.com/kubernetes-sigs/kustomize/tree/master/functions/examples/validator-kubeval
|
||||||
|
th.WriteF("/app/transf2.yaml", `
|
||||||
|
apiVersion: examples.config.kubernetes.io/v1beta1
|
||||||
|
kind: Kubeval
|
||||||
|
metadata:
|
||||||
|
name: validate
|
||||||
|
annotations:
|
||||||
|
config.kubernetes.io/function: |
|
||||||
|
container:
|
||||||
|
image: gcr.io/kustomize-functions/example-validator-kubeval:v0.1.0
|
||||||
|
spec:
|
||||||
|
strict: true
|
||||||
|
ignoreMissingSchemas: true
|
||||||
|
|
||||||
|
# TODO: Update this to use network/volumes features.
|
||||||
|
# Relevant issues:
|
||||||
|
# - https://github.com/kubernetes-sigs/kustomize/issues/1901
|
||||||
|
# - https://github.com/kubernetes-sigs/kustomize/issues/1902
|
||||||
|
kubernetesVersion: "1.16.0"
|
||||||
|
schemaLocation: "file:///schemas"
|
||||||
|
`)
|
||||||
|
m := th.Run("/app", th.MakeOptionsPluginsEnabled())
|
||||||
|
th.AssertActualEqualsExpected(m, `
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
config.kubernetes.io/path: deployment_nginx.yaml
|
||||||
|
tshirt-size: small
|
||||||
|
labels:
|
||||||
|
app: nginx
|
||||||
|
name: nginx
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: nginx
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: nginx
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- image: nginx
|
||||||
|
name: nginx
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: 200m
|
||||||
|
memory: 50M
|
||||||
|
`)
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestFnContainerTransformerWithConfig(t *testing.T) {
|
||||||
|
skipIfNoDocker(t)
|
||||||
|
|
||||||
|
th := kusttest_test.MakeEnhancedHarness(t)
|
||||||
|
defer th.Reset()
|
||||||
|
|
||||||
|
th.WriteK("/app", `
|
||||||
|
resources:
|
||||||
|
- data1.yaml
|
||||||
|
- data2.yaml
|
||||||
|
transformers:
|
||||||
|
- label_namespace.yaml
|
||||||
|
`)
|
||||||
|
|
||||||
|
th.WriteF("/app/data1.yaml", `apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: my-namespace
|
||||||
|
`)
|
||||||
|
th.WriteF("/app/data2.yaml", `apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: another-namespace
|
||||||
|
`)
|
||||||
|
|
||||||
|
th.WriteF("/app/label_namespace.yaml", `apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: label_namespace
|
||||||
|
annotations:
|
||||||
|
config.kubernetes.io/function: |-
|
||||||
|
container:
|
||||||
|
image: gcr.io/kpt-functions/label-namespace@sha256:4f030738d6d25a207641ca517916431517578bd0eb8d98a8bde04e3bb9315dcd
|
||||||
|
data:
|
||||||
|
label_name: my-ns-name
|
||||||
|
label_value: function-test
|
||||||
|
`)
|
||||||
|
|
||||||
|
m := th.Run("/app", th.MakeOptionsPluginsEnabled())
|
||||||
|
th.AssertActualEqualsExpected(m, `
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
config.kubernetes.io/path: namespace_my-namespace.yaml
|
||||||
|
labels:
|
||||||
|
my-ns-name: function-test
|
||||||
|
name: my-namespace
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
config.kubernetes.io/path: namespace_another-namespace.yaml
|
||||||
|
labels:
|
||||||
|
my-ns-name: function-test
|
||||||
|
name: another-namespace
|
||||||
|
`)
|
||||||
|
}
|
||||||
24
api/krusty/fnplugin_test/fnexectest.sh
Executable file
24
api/krusty/fnplugin_test/fnexectest.sh
Executable file
@@ -0,0 +1,24 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
cat <<EOF
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: nginx
|
||||||
|
labels:
|
||||||
|
app: nginx
|
||||||
|
annotations:
|
||||||
|
tshirt-size: small # this injects the resource reservations
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: nginx
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: nginx
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: nginx
|
||||||
|
image: nginx
|
||||||
|
EOF
|
||||||
@@ -56,7 +56,7 @@ spec:
|
|||||||
app: nginx
|
app: nginx
|
||||||
`)
|
`)
|
||||||
th.WriteF("/app/base/deployment.yaml", `
|
th.WriteF("/app/base/deployment.yaml", `
|
||||||
apiVersion: apps/v1beta2
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: nginx
|
name: nginx
|
||||||
@@ -92,7 +92,7 @@ spec:
|
|||||||
org: example.com
|
org: example.com
|
||||||
team: foo
|
team: foo
|
||||||
---
|
---
|
||||||
apiVersion: apps/v1beta2
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
@@ -150,8 +150,6 @@ spec:
|
|||||||
|
|
||||||
func makeBaseWithGenerators(th kusttest_test.Harness) {
|
func makeBaseWithGenerators(th kusttest_test.Harness) {
|
||||||
th.WriteK("/app", `
|
th.WriteK("/app", `
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
|
||||||
kind: Kustomization
|
|
||||||
namePrefix: team-foo-
|
namePrefix: team-foo-
|
||||||
commonLabels:
|
commonLabels:
|
||||||
app: mynginx
|
app: mynginx
|
||||||
@@ -173,7 +171,7 @@ secretGenerator:
|
|||||||
- password=somepw
|
- password=somepw
|
||||||
`)
|
`)
|
||||||
th.WriteF("/app/deployment.yaml", `
|
th.WriteF("/app/deployment.yaml", `
|
||||||
apiVersion: apps/v1beta2
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: nginx
|
name: nginx
|
||||||
@@ -218,7 +216,7 @@ func TestBaseWithGeneratorsAlone(t *testing.T) {
|
|||||||
makeBaseWithGenerators(th)
|
makeBaseWithGenerators(th)
|
||||||
m := th.Run("/app", th.MakeDefaultOptions())
|
m := th.Run("/app", th.MakeDefaultOptions())
|
||||||
th.AssertActualEqualsExpected(m, `
|
th.AssertActualEqualsExpected(m, `
|
||||||
apiVersion: apps/v1beta2
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
@@ -308,7 +306,7 @@ func TestMergeAndReplaceGenerators(t *testing.T) {
|
|||||||
th := kusttest_test.MakeHarness(t)
|
th := kusttest_test.MakeHarness(t)
|
||||||
makeBaseWithGenerators(th)
|
makeBaseWithGenerators(th)
|
||||||
th.WriteF("/overlay/deployment.yaml", `
|
th.WriteF("/overlay/deployment.yaml", `
|
||||||
apiVersion: apps/v1beta2
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: nginx
|
name: nginx
|
||||||
@@ -325,8 +323,6 @@ spec:
|
|||||||
name: configmap-in-overlay
|
name: configmap-in-overlay
|
||||||
`)
|
`)
|
||||||
th.WriteK("/overlay", `
|
th.WriteK("/overlay", `
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
|
||||||
kind: Kustomization
|
|
||||||
namePrefix: staging-
|
namePrefix: staging-
|
||||||
commonLabels:
|
commonLabels:
|
||||||
env: staging
|
env: staging
|
||||||
@@ -351,7 +347,7 @@ secretGenerator:
|
|||||||
`)
|
`)
|
||||||
m := th.Run("/overlay", th.MakeDefaultOptions())
|
m := th.Run("/overlay", th.MakeDefaultOptions())
|
||||||
th.AssertActualEqualsExpected(m, `
|
th.AssertActualEqualsExpected(m, `
|
||||||
apiVersion: apps/v1beta2
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
@@ -389,12 +385,12 @@ spec:
|
|||||||
- gcePersistentDisk:
|
- gcePersistentDisk:
|
||||||
pdName: nginx-persistent-storage
|
pdName: nginx-persistent-storage
|
||||||
name: nginx-persistent-storage
|
name: nginx-persistent-storage
|
||||||
- configMap:
|
|
||||||
name: staging-configmap-in-overlay-k7cbc75tg8
|
|
||||||
name: configmap-in-overlay
|
|
||||||
- configMap:
|
- configMap:
|
||||||
name: staging-team-foo-configmap-in-base-gh9d7t85gb
|
name: staging-team-foo-configmap-in-base-gh9d7t85gb
|
||||||
name: configmap-in-base
|
name: configmap-in-base
|
||||||
|
- configMap:
|
||||||
|
name: staging-configmap-in-overlay-k7cbc75tg8
|
||||||
|
name: configmap-in-overlay
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
|
|||||||
@@ -79,8 +79,7 @@ spec:
|
|||||||
- mountPath: /tmp/ps
|
- mountPath: /tmp/ps
|
||||||
name: nginx-persistent-storage
|
name: nginx-persistent-storage
|
||||||
volumes:
|
volumes:
|
||||||
- emptyDir: {}
|
- name: nginx-persistent-storage
|
||||||
name: nginx-persistent-storage
|
|
||||||
- configMap:
|
- configMap:
|
||||||
name: configmap-in-base
|
name: configmap-in-base
|
||||||
name: configmap-in-base
|
name: configmap-in-base
|
||||||
@@ -223,8 +222,7 @@ spec:
|
|||||||
- mountPath: /tmp/ps
|
- mountPath: /tmp/ps
|
||||||
name: nginx-persistent-storage
|
name: nginx-persistent-storage
|
||||||
volumes:
|
volumes:
|
||||||
- emptyDir: {}
|
- name: nginx-persistent-storage
|
||||||
name: nginx-persistent-storage
|
|
||||||
- configMap:
|
- configMap:
|
||||||
name: configmap-in-base
|
name: configmap-in-base
|
||||||
name: configmap-in-base
|
name: configmap-in-base
|
||||||
|
|||||||
@@ -10,10 +10,186 @@ import (
|
|||||||
kusttest_test "sigs.k8s.io/kustomize/api/testutils/kusttest"
|
kusttest_test "sigs.k8s.io/kustomize/api/testutils/kusttest"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func TestSimpleMultiplePatches(t *testing.T) {
|
||||||
|
th := kusttest_test.MakeHarness(t)
|
||||||
|
th.WriteK("base", `
|
||||||
|
namePrefix: b-
|
||||||
|
commonLabels:
|
||||||
|
team: foo
|
||||||
|
resources:
|
||||||
|
- deployment.yaml
|
||||||
|
- service.yaml
|
||||||
|
configMapGenerator:
|
||||||
|
- name: configmap-in-base
|
||||||
|
literals:
|
||||||
|
- foo=bar
|
||||||
|
`)
|
||||||
|
th.WriteF("base/deployment.yaml", `
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: nginx
|
||||||
|
spec:
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: nginx
|
||||||
|
image: nginx
|
||||||
|
volumeMounts:
|
||||||
|
- name: nginx-persistent-storage
|
||||||
|
mountPath: /tmp/ps
|
||||||
|
- name: sidecar
|
||||||
|
image: sidecar:latest
|
||||||
|
volumes:
|
||||||
|
- name: nginx-persistent-storage
|
||||||
|
emptyDir: {}
|
||||||
|
- configMap:
|
||||||
|
name: configmap-in-base
|
||||||
|
name: configmap-in-base
|
||||||
|
`)
|
||||||
|
th.WriteF("base/service.yaml", `
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: nginx
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- port: 80
|
||||||
|
`)
|
||||||
|
th.WriteK("overlay", `
|
||||||
|
namePrefix: a-
|
||||||
|
commonLabels:
|
||||||
|
env: staging
|
||||||
|
patchesStrategicMerge:
|
||||||
|
- deployment-patch1.yaml
|
||||||
|
- deployment-patch2.yaml
|
||||||
|
resources:
|
||||||
|
- ../base
|
||||||
|
configMapGenerator:
|
||||||
|
- name: configmap-in-overlay
|
||||||
|
literals:
|
||||||
|
- hello=world
|
||||||
|
`)
|
||||||
|
th.WriteF("overlay/deployment-patch1.yaml", `
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: nginx
|
||||||
|
spec:
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: nginx
|
||||||
|
image: nginx:latest
|
||||||
|
env:
|
||||||
|
- name: ENVKEY
|
||||||
|
value: ENVVALUE
|
||||||
|
volumes:
|
||||||
|
- name: nginx-persistent-storage
|
||||||
|
emptyDir: null
|
||||||
|
gcePersistentDisk:
|
||||||
|
pdName: nginx-persistent-storage
|
||||||
|
- configMap:
|
||||||
|
name: configmap-in-overlay
|
||||||
|
name: configmap-in-overlay
|
||||||
|
`)
|
||||||
|
th.WriteF("overlay/deployment-patch2.yaml", `
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: nginx
|
||||||
|
spec:
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: nginx
|
||||||
|
env:
|
||||||
|
- name: ANOTHERENV
|
||||||
|
value: FOO
|
||||||
|
volumes:
|
||||||
|
- name: nginx-persistent-storage
|
||||||
|
`)
|
||||||
|
m := th.Run("overlay", th.MakeDefaultOptions())
|
||||||
|
th.AssertActualEqualsExpected(m, `
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
env: staging
|
||||||
|
team: foo
|
||||||
|
name: a-b-nginx
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
env: staging
|
||||||
|
team: foo
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
env: staging
|
||||||
|
team: foo
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- env:
|
||||||
|
- name: ANOTHERENV
|
||||||
|
value: FOO
|
||||||
|
- name: ENVKEY
|
||||||
|
value: ENVVALUE
|
||||||
|
image: nginx:latest
|
||||||
|
name: nginx
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: /tmp/ps
|
||||||
|
name: nginx-persistent-storage
|
||||||
|
- image: sidecar:latest
|
||||||
|
name: sidecar
|
||||||
|
volumes:
|
||||||
|
- gcePersistentDisk:
|
||||||
|
pdName: nginx-persistent-storage
|
||||||
|
name: nginx-persistent-storage
|
||||||
|
- configMap:
|
||||||
|
name: a-b-configmap-in-base-fm96mhk4dt
|
||||||
|
name: configmap-in-base
|
||||||
|
- configMap:
|
||||||
|
name: a-configmap-in-overlay-ffm9hf78mc
|
||||||
|
name: configmap-in-overlay
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
env: staging
|
||||||
|
team: foo
|
||||||
|
name: a-b-nginx
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- port: 80
|
||||||
|
selector:
|
||||||
|
env: staging
|
||||||
|
team: foo
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
data:
|
||||||
|
foo: bar
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
env: staging
|
||||||
|
team: foo
|
||||||
|
name: a-b-configmap-in-base-fm96mhk4dt
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
data:
|
||||||
|
hello: world
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
env: staging
|
||||||
|
name: a-configmap-in-overlay-ffm9hf78mc
|
||||||
|
`)
|
||||||
|
}
|
||||||
|
|
||||||
func makeCommonFileForMultiplePatchTest(th kusttest_test.Harness) {
|
func makeCommonFileForMultiplePatchTest(th kusttest_test.Harness) {
|
||||||
th.WriteK("/app/base", `
|
th.WriteK("/app/base", `
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
|
||||||
kind: Kustomization
|
|
||||||
namePrefix: team-foo-
|
namePrefix: team-foo-
|
||||||
commonLabels:
|
commonLabels:
|
||||||
app: mynginx
|
app: mynginx
|
||||||
@@ -30,7 +206,7 @@ configMapGenerator:
|
|||||||
- foo=bar
|
- foo=bar
|
||||||
`)
|
`)
|
||||||
th.WriteF("/app/base/deployment.yaml", `
|
th.WriteF("/app/base/deployment.yaml", `
|
||||||
apiVersion: apps/v1beta2
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: nginx
|
name: nginx
|
||||||
@@ -71,8 +247,6 @@ spec:
|
|||||||
app: nginx
|
app: nginx
|
||||||
`)
|
`)
|
||||||
th.WriteK("/app/overlay/staging", `
|
th.WriteK("/app/overlay/staging", `
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
|
||||||
kind: Kustomization
|
|
||||||
namePrefix: staging-
|
namePrefix: staging-
|
||||||
commonLabels:
|
commonLabels:
|
||||||
env: staging
|
env: staging
|
||||||
@@ -92,7 +266,7 @@ func TestMultiplePatchesNoConflict(t *testing.T) {
|
|||||||
th := kusttest_test.MakeHarness(t)
|
th := kusttest_test.MakeHarness(t)
|
||||||
makeCommonFileForMultiplePatchTest(th)
|
makeCommonFileForMultiplePatchTest(th)
|
||||||
th.WriteF("/app/overlay/staging/deployment-patch1.yaml", `
|
th.WriteF("/app/overlay/staging/deployment-patch1.yaml", `
|
||||||
apiVersion: apps/v1beta2
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: nginx
|
name: nginx
|
||||||
@@ -115,7 +289,7 @@ spec:
|
|||||||
name: configmap-in-overlay
|
name: configmap-in-overlay
|
||||||
`)
|
`)
|
||||||
th.WriteF("/app/overlay/staging/deployment-patch2.yaml", `
|
th.WriteF("/app/overlay/staging/deployment-patch2.yaml", `
|
||||||
apiVersion: apps/v1beta2
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: nginx
|
name: nginx
|
||||||
@@ -132,7 +306,7 @@ spec:
|
|||||||
`)
|
`)
|
||||||
m := th.Run("/app/overlay/staging", th.MakeDefaultOptions())
|
m := th.Run("/app/overlay/staging", th.MakeDefaultOptions())
|
||||||
th.AssertActualEqualsExpected(m, `
|
th.AssertActualEqualsExpected(m, `
|
||||||
apiVersion: apps/v1beta2
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
@@ -177,12 +351,12 @@ spec:
|
|||||||
- gcePersistentDisk:
|
- gcePersistentDisk:
|
||||||
pdName: nginx-persistent-storage
|
pdName: nginx-persistent-storage
|
||||||
name: nginx-persistent-storage
|
name: nginx-persistent-storage
|
||||||
- configMap:
|
|
||||||
name: staging-configmap-in-overlay-k7cbc75tg8
|
|
||||||
name: configmap-in-overlay
|
|
||||||
- configMap:
|
- configMap:
|
||||||
name: staging-team-foo-configmap-in-base-g7k6gt2889
|
name: staging-team-foo-configmap-in-base-g7k6gt2889
|
||||||
name: configmap-in-base
|
name: configmap-in-base
|
||||||
|
- configMap:
|
||||||
|
name: staging-configmap-in-overlay-k7cbc75tg8
|
||||||
|
name: configmap-in-overlay
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
@@ -233,7 +407,7 @@ func TestMultiplePatchesWithConflict(t *testing.T) {
|
|||||||
th := kusttest_test.MakeHarness(t)
|
th := kusttest_test.MakeHarness(t)
|
||||||
makeCommonFileForMultiplePatchTest(th)
|
makeCommonFileForMultiplePatchTest(th)
|
||||||
th.WriteF("/app/overlay/staging/deployment-patch1.yaml", `
|
th.WriteF("/app/overlay/staging/deployment-patch1.yaml", `
|
||||||
apiVersion: apps/v1beta2
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: nginx
|
name: nginx
|
||||||
@@ -255,7 +429,7 @@ spec:
|
|||||||
name: configmap-in-overlay
|
name: configmap-in-overlay
|
||||||
`)
|
`)
|
||||||
th.WriteF("/app/overlay/staging/deployment-patch2.yaml", `
|
th.WriteF("/app/overlay/staging/deployment-patch2.yaml", `
|
||||||
apiVersion: apps/v1beta2
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: nginx
|
name: nginx
|
||||||
@@ -279,7 +453,7 @@ spec:
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestMultiplePatchesWithOnePatchDeleteDirective(t *testing.T) {
|
func TestMultiplePatchesWithOnePatchDeleteDirective(t *testing.T) {
|
||||||
additivePatch := `apiVersion: apps/v1beta2
|
additivePatch := `apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: nginx
|
name: nginx
|
||||||
@@ -292,7 +466,7 @@ spec:
|
|||||||
- name: SOME_NAME
|
- name: SOME_NAME
|
||||||
value: somevalue
|
value: somevalue
|
||||||
`
|
`
|
||||||
deletePatch := `apiVersion: apps/v1beta2
|
deletePatch := `apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: nginx
|
name: nginx
|
||||||
@@ -328,7 +502,7 @@ spec:
|
|||||||
th.WriteF("/app/overlay/staging/deployment-patch1.yaml", c.patch1)
|
th.WriteF("/app/overlay/staging/deployment-patch1.yaml", c.patch1)
|
||||||
th.WriteF("/app/overlay/staging/deployment-patch2.yaml", c.patch2)
|
th.WriteF("/app/overlay/staging/deployment-patch2.yaml", c.patch2)
|
||||||
m := th.Run("/app/overlay/staging", th.MakeDefaultOptions())
|
m := th.Run("/app/overlay/staging", th.MakeDefaultOptions())
|
||||||
th.AssertActualEqualsExpected(m, `apiVersion: apps/v1beta2
|
th.AssertActualEqualsExpected(m, `apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
@@ -366,8 +540,7 @@ spec:
|
|||||||
- mountPath: /tmp/ps
|
- mountPath: /tmp/ps
|
||||||
name: nginx-persistent-storage
|
name: nginx-persistent-storage
|
||||||
volumes:
|
volumes:
|
||||||
- emptyDir: {}
|
- name: nginx-persistent-storage
|
||||||
name: nginx-persistent-storage
|
|
||||||
- configMap:
|
- configMap:
|
||||||
name: staging-team-foo-configmap-in-base-g7k6gt2889
|
name: staging-team-foo-configmap-in-base-g7k6gt2889
|
||||||
name: configmap-in-base
|
name: configmap-in-base
|
||||||
@@ -423,7 +596,7 @@ func TestMultiplePatchesBothWithPatchDeleteDirective(t *testing.T) {
|
|||||||
th := kusttest_test.MakeHarness(t)
|
th := kusttest_test.MakeHarness(t)
|
||||||
makeCommonFileForMultiplePatchTest(th)
|
makeCommonFileForMultiplePatchTest(th)
|
||||||
th.WriteF("/app/overlay/staging/deployment-patch1.yaml", `
|
th.WriteF("/app/overlay/staging/deployment-patch1.yaml", `
|
||||||
apiVersion: apps/v1beta2
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: nginx
|
name: nginx
|
||||||
@@ -435,7 +608,7 @@ spec:
|
|||||||
name: sidecar
|
name: sidecar
|
||||||
`)
|
`)
|
||||||
th.WriteF("/app/overlay/staging/deployment-patch2.yaml", `
|
th.WriteF("/app/overlay/staging/deployment-patch2.yaml", `
|
||||||
apiVersion: apps/v1beta2
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: nginx
|
name: nginx
|
||||||
|
|||||||
@@ -844,8 +844,7 @@ spec:
|
|||||||
- -namespace=${POD_NAMESPACE}
|
- -namespace=${POD_NAMESPACE}
|
||||||
- -certs-dir=/cockroach-certs
|
- -certs-dir=/cockroach-certs
|
||||||
- -type=node
|
- -type=node
|
||||||
- -addresses=localhost,127.0.0.1,${POD_IP},$(hostname -f),$(hostname -f|cut
|
- -addresses=localhost,127.0.0.1,${POD_IP},$(hostname -f),$(hostname -f|cut -f 1-2 -d '.'),dev-base-cockroachdb-public
|
||||||
-f 1-2 -d '.'),dev-base-cockroachdb-public
|
|
||||||
- -symlink-ca-from=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt
|
- -symlink-ca-from=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt
|
||||||
env:
|
env:
|
||||||
- name: POD_IP
|
- name: POD_IP
|
||||||
|
|||||||
@@ -69,10 +69,10 @@ func (rf *Factory) makeOne(
|
|||||||
o = types.NewGenArgs(nil)
|
o = types.NewGenArgs(nil)
|
||||||
}
|
}
|
||||||
r := &Resource{
|
r := &Resource{
|
||||||
Kunstructured: u,
|
kunStr: u,
|
||||||
options: o,
|
options: o,
|
||||||
}
|
}
|
||||||
return r.setOriginalName(r.GetName()).setOriginalNs(r.GetNamespace())
|
return r.setOriginalName(r.kunStr.GetName()).setOriginalNs(r.GetNamespace())
|
||||||
}
|
}
|
||||||
|
|
||||||
// SliceFromPatches returns a slice of resources given a patch path
|
// SliceFromPatches returns a slice of resources given a patch path
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// Copyright 2019 The Kubernetes Authors.
|
// Copyright 2019 The Kubernetes Authors.
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
// Package resource implements representations of k8s API resources as "unstructured" objects.
|
// Package resource implements representations of k8s API resources.
|
||||||
package resource
|
package resource
|
||||||
|
|
||||||
import (
|
import (
|
||||||
@@ -14,10 +14,57 @@ import (
|
|||||||
"sigs.k8s.io/yaml"
|
"sigs.k8s.io/yaml"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Resource is map representation of a Kubernetes API resource object
|
// Resource is a representation of a Kubernetes Resource Model object paired
|
||||||
// paired with a GenerationBehavior.
|
// with metadata used by kustomize.
|
||||||
|
//
|
||||||
|
// At time of writing Resource is changing from being based on an object
|
||||||
|
// sitting behind
|
||||||
|
//
|
||||||
|
// sigs.k8s.io/kustomize/api/ifc.Unstructured
|
||||||
|
//
|
||||||
|
// to being based on an instance of
|
||||||
|
//
|
||||||
|
// sigs.k8s.io/kustomize/kyaml/yaml.RNode
|
||||||
|
//
|
||||||
|
// Ultimately, use of the Resource struct in kustomize should be entirely
|
||||||
|
// replaced by instances of RNode for direct use in kyaml, with all metadata
|
||||||
|
// stored directly in the RNodes as short-lived annotations, to be deleted
|
||||||
|
// before final output as part of a final filtration step. Using annotations
|
||||||
|
// will allow pipelined KRM Config Functions to share metadata that would
|
||||||
|
// otherwise be hidden in kustomize-only structures.
|
||||||
|
//
|
||||||
|
// ifc.Unstructured is an interface hiding an instance of
|
||||||
|
// sigs.k8s.io/kustomize/api/k8sdeps/kunstruct.UnstructAdapter
|
||||||
|
// which in turn adapts an instance of
|
||||||
|
// k8s.io/apimachinery/pkg/apis/meta/v1/unstructured
|
||||||
|
// to the ifc.Unstructured interface. This latter code handles
|
||||||
|
// mutations in the old code.
|
||||||
|
//
|
||||||
|
// The rule in kustomize development has been
|
||||||
|
// api/
|
||||||
|
// k8sdeps/ ifc/ krusty/ theRest/
|
||||||
|
//
|
||||||
|
// 1) Depend on k8s.io/ only via sigs.k8s.io/kustomize/api/k8sdeps.
|
||||||
|
//
|
||||||
|
// 2) Instances created in k8sdeps/ can only be injected into theRest/
|
||||||
|
// behind interfaces defined in ifc/, arranged by a small bit of code
|
||||||
|
// in krusty/. Nothing in theRest/ can import k8sdeps/.
|
||||||
|
//
|
||||||
|
// This was to allow for importing kustomize code into kubectl, which also
|
||||||
|
// depends on k8s.io/apimachinery, albeit via a strange, old arrangement
|
||||||
|
// predating Go modules. The idea was to copy the k8sdeps/ tree into kubectl
|
||||||
|
// via a large PR, and depend on the rest via vendoring (and a small copy of
|
||||||
|
// krusty/ code). Over 2019, however, kubectl underwent large code changes
|
||||||
|
// including a switch to Go modules, and an attempt to extract it from the
|
||||||
|
// k8s repo, and this made large kustomize integration PRs hard to get through
|
||||||
|
// code review.
|
||||||
|
//
|
||||||
|
// The new plan is to eliminate k8sdeps/ entirely, along with its k8s.io/
|
||||||
|
// dependence, switch to kyaml, and thus allow kustomize to be imported into
|
||||||
|
// kubectl via normal Go module imports.
|
||||||
|
//
|
||||||
type Resource struct {
|
type Resource struct {
|
||||||
ifc.Kunstructured
|
kunStr ifc.Kunstructured
|
||||||
originalName string
|
originalName string
|
||||||
originalNs string
|
originalNs string
|
||||||
options *types.GenArgs
|
options *types.GenArgs
|
||||||
@@ -27,6 +74,118 @@ type Resource struct {
|
|||||||
nameSuffixes []string
|
nameSuffixes []string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (r *Resource) ResetPrimaryData(incoming *Resource) {
|
||||||
|
r.kunStr = incoming.kunStr.Copy()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *Resource) GetAnnotations() map[string]string {
|
||||||
|
return r.kunStr.GetAnnotations()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *Resource) Copy() ifc.Kunstructured {
|
||||||
|
return r.kunStr.Copy()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *Resource) GetBool(p string) (bool, error) {
|
||||||
|
return r.kunStr.GetBool(p)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *Resource) GetFieldValue(f string) (interface{}, error) {
|
||||||
|
return r.kunStr.GetFieldValue(f)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *Resource) GetFloat64(p string) (float64, error) {
|
||||||
|
return r.kunStr.GetFloat64(p)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *Resource) GetGvk() resid.Gvk {
|
||||||
|
return r.kunStr.GetGvk()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *Resource) GetInt64(p string) (int64, error) {
|
||||||
|
return r.kunStr.GetInt64(p)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *Resource) GetKind() string {
|
||||||
|
return r.kunStr.GetKind()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *Resource) GetLabels() map[string]string {
|
||||||
|
return r.kunStr.GetLabels()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *Resource) GetMap(p string) (map[string]interface{}, error) {
|
||||||
|
return r.kunStr.GetMap(p)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *Resource) GetName() string {
|
||||||
|
return r.kunStr.GetName()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *Resource) GetSlice(p string) ([]interface{}, error) {
|
||||||
|
return r.kunStr.GetSlice(p)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *Resource) GetString(p string) (string, error) {
|
||||||
|
return r.kunStr.GetString(p)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *Resource) GetStringMap(p string) (map[string]string, error) {
|
||||||
|
return r.kunStr.GetStringMap(p)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *Resource) GetStringSlice(p string) ([]string, error) {
|
||||||
|
return r.kunStr.GetStringSlice(p)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *Resource) Map() map[string]interface{} {
|
||||||
|
return r.kunStr.Map()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *Resource) MarshalJSON() ([]byte, error) {
|
||||||
|
return r.kunStr.MarshalJSON()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *Resource) MatchesLabelSelector(selector string) (bool, error) {
|
||||||
|
return r.kunStr.MatchesLabelSelector(selector)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *Resource) MatchesAnnotationSelector(selector string) (bool, error) {
|
||||||
|
return r.kunStr.MatchesAnnotationSelector(selector)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *Resource) Patch(other ifc.Kunstructured) error {
|
||||||
|
return r.kunStr.Patch(other)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *Resource) SetAnnotations(m map[string]string) {
|
||||||
|
r.kunStr.SetAnnotations(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *Resource) SetGvk(gvk resid.Gvk) {
|
||||||
|
r.kunStr.SetGvk(gvk)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *Resource) SetLabels(m map[string]string) {
|
||||||
|
r.kunStr.SetLabels(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *Resource) SetMap(m map[string]interface{}) {
|
||||||
|
r.kunStr.SetMap(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *Resource) SetName(n string) {
|
||||||
|
r.kunStr.SetName(n)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *Resource) SetNamespace(n string) {
|
||||||
|
r.kunStr.SetNamespace(n)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *Resource) UnmarshalJSON(s []byte) error {
|
||||||
|
return r.kunStr.UnmarshalJSON(s)
|
||||||
|
}
|
||||||
|
|
||||||
// ResCtx is an interface describing the contextual added
|
// ResCtx is an interface describing the contextual added
|
||||||
// kept kustomize in the context of each Resource object.
|
// kept kustomize in the context of each Resource object.
|
||||||
// Currently mainly the name prefix and name suffix are added.
|
// Currently mainly the name prefix and name suffix are added.
|
||||||
@@ -46,7 +205,7 @@ type ResCtxMatcher func(ResCtx) bool
|
|||||||
// DeepCopy returns a new copy of resource
|
// DeepCopy returns a new copy of resource
|
||||||
func (r *Resource) DeepCopy() *Resource {
|
func (r *Resource) DeepCopy() *Resource {
|
||||||
rc := &Resource{
|
rc := &Resource{
|
||||||
Kunstructured: r.Kunstructured.Copy(),
|
kunStr: r.kunStr.Copy(),
|
||||||
}
|
}
|
||||||
rc.copyOtherFields(r)
|
rc.copyOtherFields(r)
|
||||||
return rc
|
return rc
|
||||||
@@ -54,11 +213,11 @@ func (r *Resource) DeepCopy() *Resource {
|
|||||||
|
|
||||||
// Replace performs replace with other resource.
|
// Replace performs replace with other resource.
|
||||||
func (r *Resource) Replace(other *Resource) {
|
func (r *Resource) Replace(other *Resource) {
|
||||||
r.SetLabels(mergeStringMaps(other.GetLabels(), r.GetLabels()))
|
r.kunStr.SetLabels(mergeStringMaps(other.kunStr.GetLabels(), r.kunStr.GetLabels()))
|
||||||
r.SetAnnotations(
|
r.kunStr.SetAnnotations(
|
||||||
mergeStringMaps(other.GetAnnotations(), r.GetAnnotations()))
|
mergeStringMaps(other.kunStr.GetAnnotations(), r.kunStr.GetAnnotations()))
|
||||||
r.SetName(other.GetName())
|
r.kunStr.SetName(other.GetName())
|
||||||
r.SetNamespace(other.GetNamespace())
|
r.kunStr.SetNamespace(other.GetNamespace())
|
||||||
r.copyOtherFields(other)
|
r.copyOtherFields(other)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -74,7 +233,7 @@ func (r *Resource) copyOtherFields(other *Resource) {
|
|||||||
|
|
||||||
func (r *Resource) Equals(o *Resource) bool {
|
func (r *Resource) Equals(o *Resource) bool {
|
||||||
return r.ReferencesEqual(o) &&
|
return r.ReferencesEqual(o) &&
|
||||||
reflect.DeepEqual(r.Kunstructured, o.Kunstructured)
|
reflect.DeepEqual(r.kunStr, o.kunStr)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *Resource) ReferencesEqual(o *Resource) bool {
|
func (r *Resource) ReferencesEqual(o *Resource) bool {
|
||||||
@@ -93,13 +252,13 @@ func (r *Resource) ReferencesEqual(o *Resource) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (r *Resource) KunstructEqual(o *Resource) bool {
|
func (r *Resource) KunstructEqual(o *Resource) bool {
|
||||||
return reflect.DeepEqual(r.Kunstructured, o.Kunstructured)
|
return reflect.DeepEqual(r.kunStr, o.kunStr)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Merge performs merge with other resource.
|
// Merge performs merge with other resource.
|
||||||
func (r *Resource) Merge(other *Resource) {
|
func (r *Resource) Merge(other *Resource) {
|
||||||
r.Replace(other)
|
r.Replace(other)
|
||||||
mergeConfigmap(r.Map(), other.Map(), r.Map())
|
mergeConfigmap(r.kunStr.Map(), other.Map(), r.Map())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *Resource) copyRefBy() []resid.ResId {
|
func (r *Resource) copyRefBy() []resid.ResId {
|
||||||
@@ -225,7 +384,7 @@ func (r *Resource) setOriginalNs(n string) *Resource {
|
|||||||
|
|
||||||
// String returns resource as JSON.
|
// String returns resource as JSON.
|
||||||
func (r *Resource) String() string {
|
func (r *Resource) String() string {
|
||||||
bs, err := r.MarshalJSON()
|
bs, err := r.kunStr.MarshalJSON()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "<" + err.Error() + ">"
|
return "<" + err.Error() + ">"
|
||||||
}
|
}
|
||||||
@@ -235,7 +394,7 @@ func (r *Resource) String() string {
|
|||||||
// AsYAML returns the resource in Yaml form.
|
// AsYAML returns the resource in Yaml form.
|
||||||
// Easier to read than JSON.
|
// Easier to read than JSON.
|
||||||
func (r *Resource) AsYAML() ([]byte, error) {
|
func (r *Resource) AsYAML() ([]byte, error) {
|
||||||
json, err := r.MarshalJSON()
|
json, err := r.kunStr.MarshalJSON()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -260,7 +419,7 @@ func (r *Resource) NeedHashSuffix() bool {
|
|||||||
|
|
||||||
// GetNamespace returns the namespace the resource thinks it's in.
|
// GetNamespace returns the namespace the resource thinks it's in.
|
||||||
func (r *Resource) GetNamespace() string {
|
func (r *Resource) GetNamespace() string {
|
||||||
namespace, _ := r.GetString("metadata.namespace")
|
namespace, _ := r.kunStr.GetString("metadata.namespace")
|
||||||
// if err, namespace is empty, so no need to check.
|
// if err, namespace is empty, so no need to check.
|
||||||
return namespace
|
return namespace
|
||||||
}
|
}
|
||||||
@@ -270,7 +429,7 @@ func (r *Resource) GetNamespace() string {
|
|||||||
// TODO: compute this once and save it in the resource.
|
// TODO: compute this once and save it in the resource.
|
||||||
func (r *Resource) OrgId() resid.ResId {
|
func (r *Resource) OrgId() resid.ResId {
|
||||||
return resid.NewResIdWithNamespace(
|
return resid.NewResIdWithNamespace(
|
||||||
r.GetGvk(), r.GetOriginalName(), r.GetOriginalNs())
|
r.kunStr.GetGvk(), r.GetOriginalName(), r.GetOriginalNs())
|
||||||
}
|
}
|
||||||
|
|
||||||
// CurId returns a ResId for the resource using the
|
// CurId returns a ResId for the resource using the
|
||||||
@@ -278,7 +437,7 @@ func (r *Resource) OrgId() resid.ResId {
|
|||||||
// This should be unique in any ResMap.
|
// This should be unique in any ResMap.
|
||||||
func (r *Resource) CurId() resid.ResId {
|
func (r *Resource) CurId() resid.ResId {
|
||||||
return resid.NewResIdWithNamespace(
|
return resid.NewResIdWithNamespace(
|
||||||
r.GetGvk(), r.GetName(), r.GetNamespace())
|
r.kunStr.GetGvk(), r.kunStr.GetName(), r.GetNamespace())
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetRefBy returns the ResIds that referred to current resource
|
// GetRefBy returns the ResIds that referred to current resource
|
||||||
|
|||||||
@@ -124,6 +124,9 @@ type Kustomization struct {
|
|||||||
// Transformers is a list of files containing transformers
|
// Transformers is a list of files containing transformers
|
||||||
Transformers []string `json:"transformers,omitempty" yaml:"transformers,omitempty"`
|
Transformers []string `json:"transformers,omitempty" yaml:"transformers,omitempty"`
|
||||||
|
|
||||||
|
// Validators is a list of files containing validators
|
||||||
|
Validators []string `json:"validators,omitempty" yaml:"validators,omitempty"`
|
||||||
|
|
||||||
// Inventory appends an object that contains the record
|
// Inventory appends an object that contains the record
|
||||||
// of all other objects, which can be used in apply, prune and delete
|
// of all other objects, which can be used in apply, prune and delete
|
||||||
Inventory *Inventory `json:"inventory,omitempty" yaml:"inventory,omitempty"`
|
Inventory *Inventory `json:"inventory,omitempty" yaml:"inventory,omitempty"`
|
||||||
|
|||||||
@@ -29,4 +29,7 @@ type PluginConfig struct {
|
|||||||
|
|
||||||
// BpLoadingOptions distinguishes builtin plugin behaviors.
|
// BpLoadingOptions distinguishes builtin plugin behaviors.
|
||||||
BpLoadingOptions BuiltinPluginLoadingOptions
|
BpLoadingOptions BuiltinPluginLoadingOptions
|
||||||
|
|
||||||
|
// FnpLoadingOptions sets the way function-based plugin behaviors.
|
||||||
|
FnpLoadingOptions FnPluginLoadingOptions
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,3 +41,16 @@ const (
|
|||||||
// to generate static code.
|
// to generate static code.
|
||||||
BploLoadFromFileSys
|
BploLoadFromFileSys
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// FnPluginLoadingOptions set way functions-based pluing are restricted
|
||||||
|
type FnPluginLoadingOptions struct {
|
||||||
|
// Allow to run executables
|
||||||
|
EnableExec bool
|
||||||
|
// Allow to run starlark
|
||||||
|
EnableStar bool
|
||||||
|
// Allow container access to network
|
||||||
|
Network bool
|
||||||
|
NetworkName string
|
||||||
|
// list of mounts
|
||||||
|
Mounts []string
|
||||||
|
}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ var (
|
|||||||
Count = commands.CountCommand
|
Count = commands.CountCommand
|
||||||
CreateSetter = commands.CreateSetterCommand
|
CreateSetter = commands.CreateSetterCommand
|
||||||
CreateSubstitution = commands.CreateSubstitutionCommand
|
CreateSubstitution = commands.CreateSubstitutionCommand
|
||||||
|
DeleteSetter = commands.DeleteSetterCommand
|
||||||
Fmt = commands.FmtCommand
|
Fmt = commands.FmtCommand
|
||||||
Grep = commands.GrepCommand
|
Grep = commands.GrepCommand
|
||||||
Init = commands.InitCommand
|
Init = commands.InitCommand
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ containers that can be chained together as part of a configuration management pi
|
|||||||
The end result of such a pipeline are fully rendered configurations that can then be
|
The end result of such a pipeline are fully rendered configurations that can then be
|
||||||
applied to a control plane (e.g. Using ‘kubectl apply’ for Kubernetes control plane).
|
applied to a control plane (e.g. Using ‘kubectl apply’ for Kubernetes control plane).
|
||||||
As such, although this document references Kubernetes Resource Model and API conventions,
|
As such, although this document references Kubernetes Resource Model and API conventions,
|
||||||
it is completely decoupled from Kuberentes API machinery and does not depend on any
|
it is completely decoupled from Kubernetes API machinery and does not depend on any
|
||||||
in-cluster components.
|
in-cluster components.
|
||||||
|
|
||||||
This document references terms described in [Kubernetes API Conventions][1].
|
This document references terms described in [Kubernetes API Conventions][1].
|
||||||
@@ -33,7 +33,7 @@ _Configuration functions_ enable shift-left practices (client-side) through:
|
|||||||
Performing these on the client rather than the server enables:
|
Performing these on the client rather than the server enables:
|
||||||
|
|
||||||
- Configuration to be reviewed prior to being sent to the API server
|
- Configuration to be reviewed prior to being sent to the API server
|
||||||
- Configuration to be validated as part of the CI?CD pipeline
|
- Configuration to be validated as part of the CI/CD pipeline
|
||||||
- Configuration for Resources to validated holistically rather than individually
|
- Configuration for Resources to validated holistically rather than individually
|
||||||
per-Resource
|
per-Resource
|
||||||
- e.g. ensure the `Service.selector` and `Deployment.spec.template` labels
|
- e.g. ensure the `Service.selector` and `Deployment.spec.template` labels
|
||||||
|
|||||||
@@ -553,6 +553,8 @@ gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
|||||||
gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
|
gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
|
||||||
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
|
gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
|
||||||
|
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
gopkg.in/yaml.v3 v3.0.0-20200121175148-a6ecf24a6d71 h1:Xe2gvTZUJpsvOWUnvmL/tmhVBZUmHSvLbMjRj6NUUKo=
|
gopkg.in/yaml.v3 v3.0.0-20200121175148-a6ecf24a6d71 h1:Xe2gvTZUJpsvOWUnvmL/tmhVBZUmHSvLbMjRj6NUUKo=
|
||||||
gopkg.in/yaml.v3 v3.0.0-20200121175148-a6ecf24a6d71/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
gopkg.in/yaml.v3 v3.0.0-20200121175148-a6ecf24a6d71/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
|
|||||||
@@ -50,6 +50,8 @@ func NewCreateSetterRunner(parent string) *CreateSetterRunner {
|
|||||||
set.Flags().MarkHidden("partial")
|
set.Flags().MarkHidden("partial")
|
||||||
set.Flags().StringVar(&setterVersion, "version", "",
|
set.Flags().StringVar(&setterVersion, "version", "",
|
||||||
"use this version of the setter format")
|
"use this version of the setter format")
|
||||||
|
set.Flags().BoolVar(&r.CreateSetter.Required, "required", false,
|
||||||
|
"indicates that this setter must be set by package consumer before live apply/preview")
|
||||||
set.Flags().StringVar(&r.CreateSetter.SchemaPath, "schema-path", "",
|
set.Flags().StringVar(&r.CreateSetter.SchemaPath, "schema-path", "",
|
||||||
`openAPI schema file path for setter constraints -- file content `+
|
`openAPI schema file path for setter constraints -- file content `+
|
||||||
`e.g. {"type": "string", "maxLength": 15, "enum": ["allowedValue1", "allowedValue2"]}`)
|
`e.g. {"type": "string", "maxLength": 15, "enum": ["allowedValue1", "allowedValue2"]}`)
|
||||||
|
|||||||
@@ -65,6 +65,44 @@ spec:
|
|||||||
replicas: 3 # {"$openapi":"replicas"}
|
replicas: 3 # {"$openapi":"replicas"}
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
name: "add replicas no match",
|
||||||
|
args: []string{"replicas", "3", "--description", "hello world", "--set-by", "me"},
|
||||||
|
input: `
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: nginx-deployment
|
||||||
|
spec:
|
||||||
|
foo: 2
|
||||||
|
`,
|
||||||
|
inputOpenAPI: `
|
||||||
|
apiVersion: v1alpha1
|
||||||
|
kind: Example
|
||||||
|
`,
|
||||||
|
expectedOpenAPI: `
|
||||||
|
apiVersion: v1alpha1
|
||||||
|
kind: Example
|
||||||
|
openAPI:
|
||||||
|
definitions:
|
||||||
|
io.k8s.cli.setters.replicas:
|
||||||
|
description: hello world
|
||||||
|
x-k8s-cli:
|
||||||
|
setter:
|
||||||
|
name: replicas
|
||||||
|
value: "3"
|
||||||
|
setBy: me
|
||||||
|
`,
|
||||||
|
expectedResources: `
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: nginx-deployment
|
||||||
|
spec:
|
||||||
|
foo: 2
|
||||||
|
`,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "error if substitution with same name exists",
|
name: "error if substitution with same name exists",
|
||||||
args: []string{"my-image", "3", "--description", "hello world", "--set-by", "me"},
|
args: []string{"my-image", "3", "--description", "hello world", "--set-by", "me"},
|
||||||
@@ -148,6 +186,21 @@ spec:
|
|||||||
- "a"
|
- "a"
|
||||||
- "b"
|
- "b"
|
||||||
- "c"
|
- "c"
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: nginx-deployment
|
||||||
|
namespace: myspace
|
||||||
|
spec:
|
||||||
|
replicas: 3
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: sidecar
|
||||||
|
image: nginx:1.7.9
|
||||||
|
- name: nginx
|
||||||
|
image: otherspace/nginx:1.7.9
|
||||||
`,
|
`,
|
||||||
inputOpenAPI: `
|
inputOpenAPI: `
|
||||||
apiVersion: v1alpha1
|
apiVersion: v1alpha1
|
||||||
@@ -190,6 +243,21 @@ spec:
|
|||||||
- "a"
|
- "a"
|
||||||
- "b"
|
- "b"
|
||||||
- "c"
|
- "c"
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: nginx-deployment
|
||||||
|
namespace: myspace
|
||||||
|
spec:
|
||||||
|
replicas: 3
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: sidecar
|
||||||
|
image: nginx:1.7.9
|
||||||
|
- name: nginx
|
||||||
|
image: otherspace/nginx:1.7.9
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
63
cmd/config/internal/commands/cmddeletesetter.go
Normal file
63
cmd/config/internal/commands/cmddeletesetter.go
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
// Copyright 2019 The Kubernetes Authors.
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
package commands
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
"sigs.k8s.io/kustomize/cmd/config/ext"
|
||||||
|
"sigs.k8s.io/kustomize/kyaml/openapi"
|
||||||
|
"sigs.k8s.io/kustomize/kyaml/setters2/settersutil"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewDeleteRunner returns a command runner.
|
||||||
|
func NewDeleteSetterRunner(parent string) *DeleteSetterRunner {
|
||||||
|
r := &DeleteSetterRunner{}
|
||||||
|
c := &cobra.Command{
|
||||||
|
Use: "delete-setter DIR NAME",
|
||||||
|
Args: cobra.MinimumNArgs(2),
|
||||||
|
Short: "delete values on Resources fields.",
|
||||||
|
Long: "",
|
||||||
|
Example: "",
|
||||||
|
PreRunE: r.preRunE,
|
||||||
|
RunE: r.runE,
|
||||||
|
}
|
||||||
|
fixDocs(parent, c)
|
||||||
|
r.Command = c
|
||||||
|
|
||||||
|
return r
|
||||||
|
}
|
||||||
|
|
||||||
|
func DeleteSetterCommand(parent string) *cobra.Command {
|
||||||
|
return NewDeleteSetterRunner(parent).Command
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteSetterRunner struct {
|
||||||
|
Command *cobra.Command
|
||||||
|
DeleteSetter settersutil.DeleterCreator
|
||||||
|
OpenAPIFile string
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *DeleteSetterRunner) preRunE(c *cobra.Command, args []string) error {
|
||||||
|
var err error
|
||||||
|
r.DeleteSetter.Name = args[1]
|
||||||
|
|
||||||
|
r.OpenAPIFile, err = ext.GetOpenAPIFile(args)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := openapi.AddSchemaFromFile(r.OpenAPIFile); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *DeleteSetterRunner) runE(c *cobra.Command, args []string) error {
|
||||||
|
return handleError(c, r.delete(c, args))
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *DeleteSetterRunner) delete(c *cobra.Command, args []string) error {
|
||||||
|
return r.DeleteSetter.Delete(r.OpenAPIFile, args[0])
|
||||||
|
}
|
||||||
302
cmd/config/internal/commands/cmddeletesetter_test.go
Normal file
302
cmd/config/internal/commands/cmddeletesetter_test.go
Normal file
@@ -0,0 +1,302 @@
|
|||||||
|
// Copyright 2019 The Kubernetes Authors.
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
package commands_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bytes"
|
||||||
|
"io/ioutil"
|
||||||
|
"os"
|
||||||
|
"strings"
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/stretchr/testify/assert"
|
||||||
|
"sigs.k8s.io/kustomize/cmd/config/ext"
|
||||||
|
"sigs.k8s.io/kustomize/cmd/config/internal/commands"
|
||||||
|
"sigs.k8s.io/kustomize/kyaml/openapi"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestDeleteSetterCommand(t *testing.T) {
|
||||||
|
var tests = []struct {
|
||||||
|
name string
|
||||||
|
input string
|
||||||
|
args []string
|
||||||
|
schema string
|
||||||
|
out string
|
||||||
|
inputOpenAPI string
|
||||||
|
expectedOpenAPI string
|
||||||
|
expectedResources string
|
||||||
|
err string
|
||||||
|
}{
|
||||||
|
{
|
||||||
|
name: "delete replicas",
|
||||||
|
args: []string{"replicas", "hello world"},
|
||||||
|
input: `
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: nginx-deployment
|
||||||
|
spec:
|
||||||
|
replicas: 3 # {"$openapi" : "replicas"}}
|
||||||
|
`,
|
||||||
|
inputOpenAPI: `
|
||||||
|
apiVersion: v1alpha1
|
||||||
|
kind: Example
|
||||||
|
openAPI:
|
||||||
|
definitions:
|
||||||
|
io.k8s.cli.setters.replicas:
|
||||||
|
description: hello world
|
||||||
|
x-k8s-cli:
|
||||||
|
setter:
|
||||||
|
name: replicas
|
||||||
|
value: "3"
|
||||||
|
setBy: me
|
||||||
|
`,
|
||||||
|
expectedOpenAPI: `
|
||||||
|
apiVersion: v1alpha1
|
||||||
|
kind: Example
|
||||||
|
`,
|
||||||
|
expectedResources: `
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: nginx-deployment
|
||||||
|
spec:
|
||||||
|
replicas: 3
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "delete only one setter",
|
||||||
|
args: []string{"replicas", "hello world"},
|
||||||
|
input: `
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: nginx-deployment
|
||||||
|
spec:
|
||||||
|
replicas: 3 # {"$openapi" : "replicas"}}
|
||||||
|
`,
|
||||||
|
inputOpenAPI: `
|
||||||
|
apiVersion: v1alpha1
|
||||||
|
kind: Example
|
||||||
|
openAPI:
|
||||||
|
definitions:
|
||||||
|
io.k8s.cli.setters.replicas:
|
||||||
|
description: hello world
|
||||||
|
x-k8s-cli:
|
||||||
|
setter:
|
||||||
|
name: replicas
|
||||||
|
value: "3"
|
||||||
|
setBy: me
|
||||||
|
io.k8s.cli.setters.image:
|
||||||
|
x-k8s-cli:
|
||||||
|
setter:
|
||||||
|
name: image
|
||||||
|
value: 1.0
|
||||||
|
`,
|
||||||
|
expectedOpenAPI: `
|
||||||
|
apiVersion: v1alpha1
|
||||||
|
kind: Example
|
||||||
|
openAPI:
|
||||||
|
definitions:
|
||||||
|
io.k8s.cli.setters.image:
|
||||||
|
x-k8s-cli:
|
||||||
|
setter:
|
||||||
|
name: image
|
||||||
|
value: 1.0
|
||||||
|
`,
|
||||||
|
expectedResources: `
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: nginx-deployment
|
||||||
|
spec:
|
||||||
|
replicas: 3
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "delete non exist setter error",
|
||||||
|
args: []string{"image", "hello world"},
|
||||||
|
input: `
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: nginx-deployment
|
||||||
|
spec:
|
||||||
|
replicas: 3 # {"$openapi" : "replicas"}}
|
||||||
|
`,
|
||||||
|
inputOpenAPI: `
|
||||||
|
apiVersion: v1alpha1
|
||||||
|
kind: Example
|
||||||
|
openAPI:
|
||||||
|
definitions:
|
||||||
|
io.k8s.cli.setters.replicas:
|
||||||
|
description: hello world
|
||||||
|
x-k8s-cli:
|
||||||
|
setter:
|
||||||
|
name: replicas
|
||||||
|
value: "3"
|
||||||
|
setBy: me
|
||||||
|
`,
|
||||||
|
expectedOpenAPI: `
|
||||||
|
apiVersion: v1alpha1
|
||||||
|
kind: Example
|
||||||
|
openAPI:
|
||||||
|
definitions:
|
||||||
|
io.k8s.cli.setters.replicas:
|
||||||
|
description: hello world
|
||||||
|
x-k8s-cli:
|
||||||
|
setter:
|
||||||
|
name: replicas
|
||||||
|
value: "3"
|
||||||
|
setBy: me
|
||||||
|
`,
|
||||||
|
expectedResources: `
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: nginx-deployment
|
||||||
|
spec:
|
||||||
|
replicas: 3 # {"$openapi" : "replicas"}}
|
||||||
|
`,
|
||||||
|
err: `setter does not exist`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "delete setter used in substitution error",
|
||||||
|
args: []string{"image-name", "hello world"},
|
||||||
|
input: `
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
`,
|
||||||
|
inputOpenAPI: `
|
||||||
|
openAPI:
|
||||||
|
definitions:
|
||||||
|
io.k8s.cli.setters.image-name:
|
||||||
|
x-k8s-cli:
|
||||||
|
setter:
|
||||||
|
name: image-name
|
||||||
|
value: "nginx"
|
||||||
|
io.k8s.cli.setters.image-tag:
|
||||||
|
x-k8s-cli:
|
||||||
|
setter:
|
||||||
|
name: image-tag
|
||||||
|
value: "1.8.1"
|
||||||
|
io.k8s.cli.substitutions.image:
|
||||||
|
x-k8s-cli:
|
||||||
|
substitution:
|
||||||
|
name: image
|
||||||
|
pattern: IMAGE_NAME:IMAGE_TAG
|
||||||
|
values:
|
||||||
|
- marker: "IMAGE_NAME"
|
||||||
|
ref: "#/definitions/io.k8s.cli.setters.image-name"
|
||||||
|
- marker: "IMAGE_TAG"
|
||||||
|
ref: "#/definitions/io.k8s.cli.setters.image-tag"
|
||||||
|
`,
|
||||||
|
expectedOpenAPI: `
|
||||||
|
openAPI:
|
||||||
|
definitions:
|
||||||
|
io.k8s.cli.setters.image-name:
|
||||||
|
x-k8s-cli:
|
||||||
|
setter:
|
||||||
|
name: image-name
|
||||||
|
value: "nginx"
|
||||||
|
io.k8s.cli.setters.image-tag:
|
||||||
|
x-k8s-cli:
|
||||||
|
setter:
|
||||||
|
name: image-tag
|
||||||
|
value: "1.8.1"
|
||||||
|
io.k8s.cli.substitutions.image:
|
||||||
|
x-k8s-cli:
|
||||||
|
substitution:
|
||||||
|
name: image
|
||||||
|
pattern: IMAGE_NAME:IMAGE_TAG
|
||||||
|
values:
|
||||||
|
- marker: "IMAGE_NAME"
|
||||||
|
ref: "#/definitions/io.k8s.cli.setters.image-name"
|
||||||
|
- marker: "IMAGE_TAG"
|
||||||
|
ref: "#/definitions/io.k8s.cli.setters.image-tag"
|
||||||
|
`,
|
||||||
|
expectedResources: `
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
`,
|
||||||
|
err: `setter is used in substitution image, please delete the substitution first`,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
for i := range tests {
|
||||||
|
test := tests[i]
|
||||||
|
t.Run(test.name, func(t *testing.T) {
|
||||||
|
// reset the openAPI afterward
|
||||||
|
openapi.ResetOpenAPI()
|
||||||
|
defer openapi.ResetOpenAPI()
|
||||||
|
|
||||||
|
f, err := ioutil.TempFile("", "k8s-cli-")
|
||||||
|
if !assert.NoError(t, err) {
|
||||||
|
t.FailNow()
|
||||||
|
}
|
||||||
|
defer os.Remove(f.Name())
|
||||||
|
|
||||||
|
err = ioutil.WriteFile(f.Name(), []byte(test.inputOpenAPI), 0600)
|
||||||
|
if !assert.NoError(t, err) {
|
||||||
|
t.FailNow()
|
||||||
|
}
|
||||||
|
|
||||||
|
old := ext.GetOpenAPIFile
|
||||||
|
defer func() { ext.GetOpenAPIFile = old }()
|
||||||
|
ext.GetOpenAPIFile = func(args []string) (s string, err error) {
|
||||||
|
return f.Name(), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
r, err := ioutil.TempFile("", "k8s-cli-*.yaml")
|
||||||
|
if !assert.NoError(t, err) {
|
||||||
|
t.FailNow()
|
||||||
|
}
|
||||||
|
defer os.Remove(r.Name())
|
||||||
|
err = ioutil.WriteFile(r.Name(), []byte(test.input), 0600)
|
||||||
|
if !assert.NoError(t, err) {
|
||||||
|
t.FailNow()
|
||||||
|
}
|
||||||
|
|
||||||
|
runner := commands.NewDeleteSetterRunner("")
|
||||||
|
out := &bytes.Buffer{}
|
||||||
|
runner.Command.SetOut(out)
|
||||||
|
runner.Command.SetArgs(append([]string{r.Name()}, test.args...))
|
||||||
|
err = runner.Command.Execute()
|
||||||
|
if test.err != "" {
|
||||||
|
if !assert.NotNil(t, err) {
|
||||||
|
t.FailNow()
|
||||||
|
} else {
|
||||||
|
assert.Equal(t, err.Error(), test.err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if !assert.NoError(t, err) {
|
||||||
|
t.FailNow()
|
||||||
|
}
|
||||||
|
|
||||||
|
if !assert.Equal(t, test.out, out.String()) {
|
||||||
|
t.FailNow()
|
||||||
|
}
|
||||||
|
|
||||||
|
actualResources, err := ioutil.ReadFile(r.Name())
|
||||||
|
if !assert.NoError(t, err) {
|
||||||
|
t.FailNow()
|
||||||
|
}
|
||||||
|
if !assert.Equal(t,
|
||||||
|
strings.TrimSpace(test.expectedResources),
|
||||||
|
strings.TrimSpace(string(actualResources))) {
|
||||||
|
t.FailNow()
|
||||||
|
}
|
||||||
|
|
||||||
|
actualOpenAPI, err := ioutil.ReadFile(f.Name())
|
||||||
|
if !assert.NoError(t, err) {
|
||||||
|
t.FailNow()
|
||||||
|
}
|
||||||
|
if !assert.Equal(t,
|
||||||
|
strings.TrimSpace(test.expectedOpenAPI),
|
||||||
|
strings.TrimSpace(string(actualOpenAPI))) {
|
||||||
|
t.FailNow()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -32,6 +32,8 @@ func NewListSettersRunner(parent string) *ListSettersRunner {
|
|||||||
}
|
}
|
||||||
c.Flags().BoolVar(&r.Markdown, "markdown", false,
|
c.Flags().BoolVar(&r.Markdown, "markdown", false,
|
||||||
"output as github markdown")
|
"output as github markdown")
|
||||||
|
c.Flags().BoolVar(&r.IncludeSubst, "include-subst", false,
|
||||||
|
"include substitutions in the output")
|
||||||
fixDocs(parent, c)
|
fixDocs(parent, c)
|
||||||
r.Command = c
|
r.Command = c
|
||||||
return r
|
return r
|
||||||
@@ -42,10 +44,11 @@ func ListSettersCommand(parent string) *cobra.Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ListSettersRunner struct {
|
type ListSettersRunner struct {
|
||||||
Command *cobra.Command
|
Command *cobra.Command
|
||||||
Lookup setters.LookupSetters
|
Lookup setters.LookupSetters
|
||||||
List setters2.List
|
List setters2.List
|
||||||
Markdown bool
|
Markdown bool
|
||||||
|
IncludeSubst bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *ListSettersRunner) preRunE(c *cobra.Command, args []string) error {
|
func (r *ListSettersRunner) preRunE(c *cobra.Command, args []string) error {
|
||||||
@@ -63,7 +66,10 @@ func (r *ListSettersRunner) runE(c *cobra.Command, args []string) error {
|
|||||||
if err := r.ListSetters(c, args); err != nil {
|
if err := r.ListSetters(c, args); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return r.ListSubstitutions(c, args)
|
if r.IncludeSubst {
|
||||||
|
return r.ListSubstitutions(c, args)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return handleError(c, lookup(r.Lookup, c, args))
|
return handleError(c, lookup(r.Lookup, c, args))
|
||||||
@@ -79,7 +85,7 @@ func (r *ListSettersRunner) ListSetters(c *cobra.Command, args []string) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
table := newTable(c.OutOrStdout(), r.Markdown)
|
table := newTable(c.OutOrStdout(), r.Markdown)
|
||||||
table.SetHeader([]string{"NAME", "VALUE", "SET BY", "DESCRIPTION", "COUNT"})
|
table.SetHeader([]string{"NAME", "VALUE", "SET BY", "DESCRIPTION", "COUNT", "REQUIRED"})
|
||||||
for i := range r.List.Setters {
|
for i := range r.List.Setters {
|
||||||
s := r.List.Setters[i]
|
s := r.List.Setters[i]
|
||||||
v := s.Value
|
v := s.Value
|
||||||
@@ -89,8 +95,14 @@ func (r *ListSettersRunner) ListSetters(c *cobra.Command, args []string) error {
|
|||||||
v = strings.Join(s.ListValues, ",")
|
v = strings.Join(s.ListValues, ",")
|
||||||
v = fmt.Sprintf("[%s]", v)
|
v = fmt.Sprintf("[%s]", v)
|
||||||
}
|
}
|
||||||
|
var required string
|
||||||
|
if s.Required {
|
||||||
|
required = "Yes"
|
||||||
|
} else {
|
||||||
|
required = "No"
|
||||||
|
}
|
||||||
table.Append([]string{
|
table.Append([]string{
|
||||||
s.Name, v, s.SetBy, s.Description, fmt.Sprintf("%d", s.Count)})
|
s.Name, v, s.SetBy, s.Description, fmt.Sprintf("%d", s.Count), required})
|
||||||
}
|
}
|
||||||
table.Render()
|
table.Render()
|
||||||
|
|
||||||
@@ -113,6 +125,9 @@ func (r *ListSettersRunner) ListSubstitutions(c *cobra.Command, args []string) e
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
table := newTable(c.OutOrStdout(), r.Markdown)
|
table := newTable(c.OutOrStdout(), r.Markdown)
|
||||||
|
b := tablewriter.Border{Top: true}
|
||||||
|
table.SetBorders(b)
|
||||||
|
|
||||||
table.SetHeader([]string{"SUBSTITUTION", "PATTERN", "REFERENCES"})
|
table.SetHeader([]string{"SUBSTITUTION", "PATTERN", "REFERENCES"})
|
||||||
for i := range r.List.Substitutions {
|
for i := range r.List.Substitutions {
|
||||||
s := r.List.Substitutions[i]
|
s := r.List.Substitutions[i]
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
@@ -34,6 +35,7 @@ openAPI:
|
|||||||
name: replicas
|
name: replicas
|
||||||
value: "3"
|
value: "3"
|
||||||
setBy: me
|
setBy: me
|
||||||
|
required: true
|
||||||
description: "hello world"
|
description: "hello world"
|
||||||
`,
|
`,
|
||||||
input: `
|
input: `
|
||||||
@@ -44,12 +46,39 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
replicas: 3 # {"$ref": "#/definitions/io.k8s.cli.setters.replicas"}
|
replicas: 3 # {"$ref": "#/definitions/io.k8s.cli.setters.replicas"}
|
||||||
`,
|
`,
|
||||||
expected: ` NAME VALUE SET BY DESCRIPTION COUNT
|
expected: ` NAME VALUE SET BY DESCRIPTION COUNT REQUIRED
|
||||||
replicas 3 me hello world 1
|
replicas 3 me hello world 1 Yes
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
name: "list-replicas inconsistent with openapi",
|
||||||
|
openapi: `
|
||||||
|
openAPI:
|
||||||
|
definitions:
|
||||||
|
io.k8s.cli.setters.replicas:
|
||||||
|
x-k8s-cli:
|
||||||
|
setter:
|
||||||
|
name: replicas
|
||||||
|
value: "4"
|
||||||
|
setBy: me
|
||||||
|
description: "hello world"
|
||||||
|
`,
|
||||||
|
input: `
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: nginx-deployment
|
||||||
|
spec:
|
||||||
|
replicas: 3 # {"$ref": "#/definitions/io.k8s.cli.setters.replicas"}
|
||||||
|
`,
|
||||||
|
expected: ` NAME VALUE SET BY DESCRIPTION COUNT REQUIRED
|
||||||
|
replicas 4 me hello world 1 No
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "list-multiple",
|
name: "list-multiple",
|
||||||
|
args: []string{"--include-subst"},
|
||||||
openapi: `
|
openapi: `
|
||||||
openAPI:
|
openAPI:
|
||||||
definitions:
|
definitions:
|
||||||
@@ -74,6 +103,8 @@ openAPI:
|
|||||||
name: tag
|
name: tag
|
||||||
value: "1.7.9"
|
value: "1.7.9"
|
||||||
setBy: me3
|
setBy: me3
|
||||||
|
required: true
|
||||||
|
isSet: false
|
||||||
io.k8s.cli.substitutions.image:
|
io.k8s.cli.substitutions.image:
|
||||||
x-k8s-cli:
|
x-k8s-cli:
|
||||||
substitution:
|
substitution:
|
||||||
@@ -100,16 +131,18 @@ spec:
|
|||||||
- name: nginx2
|
- name: nginx2
|
||||||
image: nginx # {"$ref": "#/definitions/io.k8s.cli.setters.image"}
|
image: nginx # {"$ref": "#/definitions/io.k8s.cli.setters.image"}
|
||||||
`,
|
`,
|
||||||
expected: ` NAME VALUE SET BY DESCRIPTION COUNT
|
expected: ` NAME VALUE SET BY DESCRIPTION COUNT REQUIRED
|
||||||
image nginx me2 hello world 2 2
|
image nginx me2 hello world 2 2 No
|
||||||
replicas 3 me1 hello world 1 1
|
replicas 3 me1 hello world 1 1 No
|
||||||
tag 1.7.9 me3 hello world 3 1
|
tag 1.7.9 me3 hello world 3 1 Yes
|
||||||
|
--------------- ----------- --------------
|
||||||
SUBSTITUTION PATTERN REFERENCES
|
SUBSTITUTION PATTERN REFERENCES
|
||||||
image IMAGE:TAG [image,tag]
|
image IMAGE:TAG [image,tag]
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "list-multiple-resources",
|
name: "list-multiple-resources",
|
||||||
|
args: []string{"--include-subst"},
|
||||||
openapi: `
|
openapi: `
|
||||||
openAPI:
|
openAPI:
|
||||||
definitions:
|
definitions:
|
||||||
@@ -174,10 +207,11 @@ spec:
|
|||||||
- name: nginx2
|
- name: nginx2
|
||||||
image: nginx
|
image: nginx
|
||||||
`,
|
`,
|
||||||
expected: ` NAME VALUE SET BY DESCRIPTION COUNT
|
expected: ` NAME VALUE SET BY DESCRIPTION COUNT REQUIRED
|
||||||
image nginx me2 hello world 2 3
|
image nginx me2 hello world 2 3 No
|
||||||
replicas 3 me1 hello world 1 2
|
replicas 3 me1 hello world 1 2 No
|
||||||
tag 1.7.9 me3 hello world 3 2
|
tag 1.7.9 me3 hello world 3 2 No
|
||||||
|
--------------- ----------- --------------
|
||||||
SUBSTITUTION PATTERN REFERENCES
|
SUBSTITUTION PATTERN REFERENCES
|
||||||
image IMAGE:TAG [image,tag]
|
image IMAGE:TAG [image,tag]
|
||||||
`,
|
`,
|
||||||
@@ -202,6 +236,7 @@ openAPI:
|
|||||||
name: image
|
name: image
|
||||||
value: "nginx"
|
value: "nginx"
|
||||||
setBy: me2
|
setBy: me2
|
||||||
|
required: true
|
||||||
io.k8s.cli.setters.tag:
|
io.k8s.cli.setters.tag:
|
||||||
description: "hello world 3"
|
description: "hello world 3"
|
||||||
x-k8s-cli:
|
x-k8s-cli:
|
||||||
@@ -209,10 +244,10 @@ openAPI:
|
|||||||
name: tag
|
name: tag
|
||||||
value: "1.7.9"
|
value: "1.7.9"
|
||||||
setBy: me3
|
setBy: me3
|
||||||
io.k8s.cli.substitutions.image:
|
io.k8s.cli.substitutions.image-subst:
|
||||||
x-k8s-cli:
|
x-k8s-cli:
|
||||||
substitution:
|
substitution:
|
||||||
name: image
|
name: image-subst
|
||||||
pattern: IMAGE:TAG
|
pattern: IMAGE:TAG
|
||||||
values:
|
values:
|
||||||
- marker: IMAGE
|
- marker: IMAGE
|
||||||
@@ -231,7 +266,7 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: nginx
|
- name: nginx
|
||||||
image: nginx:1.7.9 # {"$ref": "#/definitions/io.k8s.cli.substitutions.image"}
|
image: nginx:1.7.9 # {"$ref": "#/definitions/io.k8s.cli.substitutions.image-subst"}
|
||||||
- name: nginx2
|
- name: nginx2
|
||||||
image: nginx # {"$ref": "#/definitions/io.k8s.cli.setters.image"}
|
image: nginx # {"$ref": "#/definitions/io.k8s.cli.setters.image"}
|
||||||
---
|
---
|
||||||
@@ -245,14 +280,12 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: nginx
|
- name: nginx
|
||||||
image: nginx:1.7.9 # {"$ref": "#/definitions/io.k8s.cli.substitutions.image"}
|
image: nginx:1.7.9 # {"$ref": "#/definitions/io.k8s.cli.substitutions.image-subst"}
|
||||||
- name: nginx2
|
- name: nginx2
|
||||||
image: nginx
|
image: nginx
|
||||||
`,
|
`,
|
||||||
expected: ` NAME VALUE SET BY DESCRIPTION COUNT
|
expected: ` NAME VALUE SET BY DESCRIPTION COUNT REQUIRED
|
||||||
image nginx me2 hello world 2 3
|
image nginx me2 hello world 2 3 Yes
|
||||||
SUBSTITUTION PATTERN REFERENCES
|
|
||||||
image IMAGE:TAG [image,tag]
|
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -277,6 +310,7 @@ openAPI:
|
|||||||
- b
|
- b
|
||||||
- c
|
- c
|
||||||
setBy: me
|
setBy: me
|
||||||
|
required: true
|
||||||
`,
|
`,
|
||||||
input: `
|
input: `
|
||||||
apiVersion: example.com/v1beta1
|
apiVersion: example.com/v1beta1
|
||||||
@@ -290,13 +324,14 @@ spec:
|
|||||||
- "b"
|
- "b"
|
||||||
- "c"
|
- "c"
|
||||||
`,
|
`,
|
||||||
expected: ` NAME VALUE SET BY DESCRIPTION COUNT
|
expected: ` NAME VALUE SET BY DESCRIPTION COUNT REQUIRED
|
||||||
list [a,b,c] me hello world 1
|
list [a,b,c] me hello world 1 Yes
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
name: "nested substitution",
|
name: "nested substitution",
|
||||||
|
args: []string{"--include-subst"},
|
||||||
input: `
|
input: `
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
@@ -327,6 +362,8 @@ openAPI:
|
|||||||
setter:
|
setter:
|
||||||
name: my-tag-setter
|
name: my-tag-setter
|
||||||
value: 1.7.9
|
value: 1.7.9
|
||||||
|
required: true
|
||||||
|
isSet: true
|
||||||
io.k8s.cli.substitutions.my-image-subst:
|
io.k8s.cli.substitutions.my-image-subst:
|
||||||
x-k8s-cli:
|
x-k8s-cli:
|
||||||
substitution:
|
substitution:
|
||||||
@@ -353,10 +390,11 @@ openAPI:
|
|||||||
name: my-other-setter
|
name: my-other-setter
|
||||||
value: nginxotherthing
|
value: nginxotherthing
|
||||||
`,
|
`,
|
||||||
expected: ` NAME VALUE SET BY DESCRIPTION COUNT
|
expected: ` NAME VALUE SET BY DESCRIPTION COUNT REQUIRED
|
||||||
my-image-setter nginx 2
|
my-image-setter nginx 2 No
|
||||||
my-other-setter nginxotherthing 1
|
my-other-setter nginxotherthing 1 No
|
||||||
my-tag-setter 1.7.9 2
|
my-tag-setter 1.7.9 2 Yes
|
||||||
|
------------------ ------------------------------------------------ -----------------------------------
|
||||||
SUBSTITUTION PATTERN REFERENCES
|
SUBSTITUTION PATTERN REFERENCES
|
||||||
my-image-subst ${my-image-setter}::${my-tag-setter} [my-image-setter,my-tag-setter]
|
my-image-subst ${my-image-setter}::${my-tag-setter} [my-image-setter,my-tag-setter]
|
||||||
my-nested-subst something/${my-image-subst}/${my-other-setter} [my-image-subst,my-other-setter]
|
my-nested-subst something/${my-image-subst}/${my-other-setter} [my-image-subst,my-other-setter]
|
||||||
@@ -407,6 +445,27 @@ openAPI:
|
|||||||
if !assert.Equal(t, test.expected, actual.String()) {
|
if !assert.Equal(t, test.expected, actual.String()) {
|
||||||
t.FailNow()
|
t.FailNow()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// make sure that the resources are not altered
|
||||||
|
actualResources, err := ioutil.ReadFile(r.Name())
|
||||||
|
if !assert.NoError(t, err) {
|
||||||
|
t.FailNow()
|
||||||
|
}
|
||||||
|
if !assert.Equal(t,
|
||||||
|
strings.TrimSpace(test.input),
|
||||||
|
strings.TrimSpace(string(actualResources))) {
|
||||||
|
t.FailNow()
|
||||||
|
}
|
||||||
|
|
||||||
|
actualOpenAPI, err := ioutil.ReadFile(f.Name())
|
||||||
|
if !assert.NoError(t, err) {
|
||||||
|
t.FailNow()
|
||||||
|
}
|
||||||
|
if !assert.Equal(t,
|
||||||
|
strings.TrimSpace(test.openapi),
|
||||||
|
strings.TrimSpace(string(actualOpenAPI))) {
|
||||||
|
t.FailNow()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ openAPI:
|
|||||||
name: replicas
|
name: replicas
|
||||||
value: "4"
|
value: "4"
|
||||||
setBy: pw
|
setBy: pw
|
||||||
|
isSet: true
|
||||||
`,
|
`,
|
||||||
expectedResources: `
|
expectedResources: `
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
@@ -158,6 +159,7 @@ openAPI:
|
|||||||
setter:
|
setter:
|
||||||
name: replicas
|
name: replicas
|
||||||
value: "4"
|
value: "4"
|
||||||
|
isSet: true
|
||||||
`,
|
`,
|
||||||
expectedResources: `
|
expectedResources: `
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
@@ -229,6 +231,7 @@ openAPI:
|
|||||||
setter:
|
setter:
|
||||||
name: tag
|
name: tag
|
||||||
value: "1.8.1"
|
value: "1.8.1"
|
||||||
|
isSet: true
|
||||||
io.k8s.cli.substitutions.image:
|
io.k8s.cli.substitutions.image:
|
||||||
x-k8s-cli:
|
x-k8s-cli:
|
||||||
substitution:
|
substitution:
|
||||||
@@ -539,6 +542,7 @@ openAPI:
|
|||||||
setter:
|
setter:
|
||||||
name: replicas
|
name: replicas
|
||||||
value: "4"
|
value: "4"
|
||||||
|
isSet: true
|
||||||
`,
|
`,
|
||||||
expectedResources: `
|
expectedResources: `
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
@@ -639,6 +643,7 @@ openAPI:
|
|||||||
listValues:
|
listValues:
|
||||||
- "10"
|
- "10"
|
||||||
- "11"
|
- "11"
|
||||||
|
isSet: true
|
||||||
`,
|
`,
|
||||||
expectedResources: `
|
expectedResources: `
|
||||||
apiVersion: example.com/v1beta1
|
apiVersion: example.com/v1beta1
|
||||||
@@ -771,6 +776,7 @@ openAPI:
|
|||||||
setter:
|
setter:
|
||||||
name: my-image-setter
|
name: my-image-setter
|
||||||
value: ubuntu
|
value: ubuntu
|
||||||
|
isSet: true
|
||||||
io.k8s.cli.setters.my-tag-setter:
|
io.k8s.cli.setters.my-tag-setter:
|
||||||
x-k8s-cli:
|
x-k8s-cli:
|
||||||
setter:
|
setter:
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ func TestRunE2e(t *testing.T) {
|
|||||||
expectedErr string
|
expectedErr string
|
||||||
skipIfFalseEnv string
|
skipIfFalseEnv string
|
||||||
}{
|
}{
|
||||||
|
|
||||||
{
|
{
|
||||||
name: "exec_function_no_args",
|
name: "exec_function_no_args",
|
||||||
args: func(d string) []string {
|
args: func(d string) []string {
|
||||||
@@ -63,6 +64,36 @@ metadata:
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
name: "exec_function_no_args_json",
|
||||||
|
args: func(d string) []string {
|
||||||
|
return []string{
|
||||||
|
"--enable-exec", "--exec-path", filepath.Join(d, "e2econtainerconfig"),
|
||||||
|
}
|
||||||
|
},
|
||||||
|
files: func(d string) map[string]string {
|
||||||
|
return map[string]string{
|
||||||
|
"deployment.json": `
|
||||||
|
{
|
||||||
|
"apiVersion": "apps/v1",
|
||||||
|
"kind": "Deployment",
|
||||||
|
"metadata": {
|
||||||
|
"name": "foo"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
expectedFiles: func(d string) map[string]string {
|
||||||
|
return map[string]string{
|
||||||
|
"deployment.json": `
|
||||||
|
{"apiVersion": "apps/v1", "kind": "Deployment", "metadata": {"name": "foo", annotations: {
|
||||||
|
a-string-value: '', a-int-value: '0', a-bool-value: 'false'}}}
|
||||||
|
`,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
name: "exec_function_args",
|
name: "exec_function_args",
|
||||||
args: func(d string) []string {
|
args: func(d string) []string {
|
||||||
@@ -468,7 +499,6 @@ def run(r, fc):
|
|||||||
resource["metadata"]["annotations"]["a-string-value"] = fc["data"]["stringValue"]
|
resource["metadata"]["annotations"]["a-string-value"] = fc["data"]["stringValue"]
|
||||||
resource["metadata"]["annotations"]["a-int-value"] = fc["data"]["intValue"]
|
resource["metadata"]["annotations"]["a-int-value"] = fc["data"]["intValue"]
|
||||||
resource["metadata"]["annotations"]["a-bool-value"] = fc["data"]["boolValue"]
|
resource["metadata"]["annotations"]["a-bool-value"] = fc["data"]["boolValue"]
|
||||||
|
|
||||||
run(ctx.resource_list["items"], ctx.resource_list["functionConfig"])
|
run(ctx.resource_list["items"], ctx.resource_list["functionConfig"])
|
||||||
`,
|
`,
|
||||||
"config.yaml": `
|
"config.yaml": `
|
||||||
@@ -545,7 +575,6 @@ def run(r, fc):
|
|||||||
resource["metadata"]["annotations"]["a-string-value"] = fc["data"]["stringValue"]
|
resource["metadata"]["annotations"]["a-string-value"] = fc["data"]["stringValue"]
|
||||||
resource["metadata"]["annotations"]["a-int-value"] = fc["data"]["intValue"]
|
resource["metadata"]["annotations"]["a-int-value"] = fc["data"]["intValue"]
|
||||||
resource["metadata"]["annotations"]["a-bool-value"] = fc["data"]["boolValue"]
|
resource["metadata"]["annotations"]["a-bool-value"] = fc["data"]["boolValue"]
|
||||||
|
|
||||||
run(ctx.resource_list["items"], ctx.resource_list["functionConfig"])
|
run(ctx.resource_list["items"], ctx.resource_list["functionConfig"])
|
||||||
`,
|
`,
|
||||||
"deployment.yaml": `
|
"deployment.yaml": `
|
||||||
|
|||||||
@@ -34,8 +34,8 @@ openAPI:
|
|||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
expectedStdOut: `
|
expectedStdOut: `
|
||||||
NAME VALUE SET BY DESCRIPTION COUNT
|
NAME VALUE SET BY DESCRIPTION COUNT REQUIRED
|
||||||
replicas 3 1
|
replicas 3 1 No
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ openAPI:
|
|||||||
setter:
|
setter:
|
||||||
name: replicas
|
name: replicas
|
||||||
value: "4"
|
value: "4"
|
||||||
|
isSet: true
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -31,8 +31,8 @@ func GetGrepRunner(name string) *GrepRunner {
|
|||||||
"also print resources from subpackages.")
|
"also print resources from subpackages.")
|
||||||
c.Flags().BoolVar(&r.KeepAnnotations, "annotate", true,
|
c.Flags().BoolVar(&r.KeepAnnotations, "annotate", true,
|
||||||
"annotate resources with their file origins.")
|
"annotate resources with their file origins.")
|
||||||
c.Flags().BoolVarP(&r.InvertMatch, "invert-match", "v", false,
|
c.Flags().BoolVarP(&r.InvertMatch, "invert-match", "", false,
|
||||||
" Selected Resources are those not matching any of the specified patterns..")
|
"Selected Resources are those not matching any of the specified patterns..")
|
||||||
|
|
||||||
r.Command = c
|
r.Command = c
|
||||||
return r
|
return r
|
||||||
|
|||||||
@@ -136,6 +136,51 @@ spec:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestSinkCommandJSON(t *testing.T) {
|
||||||
|
d, err := ioutil.TempDir("", "kustomize-source-test")
|
||||||
|
if !assert.NoError(t, err) {
|
||||||
|
t.FailNow()
|
||||||
|
}
|
||||||
|
defer os.RemoveAll(d)
|
||||||
|
|
||||||
|
r := commands.GetSinkRunner("")
|
||||||
|
r.Command.SetIn(bytes.NewBufferString(`apiVersion: config.kubernetes.io/v1alpha1
|
||||||
|
kind: ResourceList
|
||||||
|
items:
|
||||||
|
- {"kind": "Deployment", "metadata": {"labels": {"app": "nginx2"}, "name": "foo",
|
||||||
|
"annotations": {"app": "nginx2", config.kubernetes.io/index: '0',
|
||||||
|
config.kubernetes.io/path: 'f1.json'}}, "spec": {"replicas": 1}}
|
||||||
|
`))
|
||||||
|
r.Command.SetArgs([]string{d})
|
||||||
|
if !assert.NoError(t, r.Command.Execute()) {
|
||||||
|
t.FailNow()
|
||||||
|
}
|
||||||
|
|
||||||
|
actual, err := ioutil.ReadFile(filepath.Join(d, "f1.json"))
|
||||||
|
if !assert.NoError(t, err) {
|
||||||
|
t.FailNow()
|
||||||
|
}
|
||||||
|
expected := `{
|
||||||
|
"kind": "Deployment",
|
||||||
|
"metadata": {
|
||||||
|
"annotations": {
|
||||||
|
"app": "nginx2"
|
||||||
|
},
|
||||||
|
"labels": {
|
||||||
|
"app": "nginx2"
|
||||||
|
},
|
||||||
|
"name": "foo"
|
||||||
|
},
|
||||||
|
"spec": {
|
||||||
|
"replicas": 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`
|
||||||
|
if !assert.Equal(t, expected, string(actual)) {
|
||||||
|
t.FailNow()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestSinkCommand_Stdout(t *testing.T) {
|
func TestSinkCommand_Stdout(t *testing.T) {
|
||||||
d, err := ioutil.TempDir("", "kustomize-source-test")
|
d, err := ioutil.TempDir("", "kustomize-source-test")
|
||||||
if !assert.NoError(t, err) {
|
if !assert.NoError(t, err) {
|
||||||
@@ -249,3 +294,49 @@ spec:
|
|||||||
t.FailNow()
|
t.FailNow()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestSinkCommandJSON_Stdout(t *testing.T) {
|
||||||
|
d, err := ioutil.TempDir("", "kustomize-source-test")
|
||||||
|
if !assert.NoError(t, err) {
|
||||||
|
t.FailNow()
|
||||||
|
}
|
||||||
|
defer os.RemoveAll(d)
|
||||||
|
|
||||||
|
// fmt the files
|
||||||
|
out := &bytes.Buffer{}
|
||||||
|
r := commands.GetSinkRunner("")
|
||||||
|
r.Command.SetIn(bytes.NewBufferString(`apiVersion: config.kubernetes.io/v1alpha1
|
||||||
|
kind: ResourceList
|
||||||
|
items:
|
||||||
|
- {"kind": "Deployment", "metadata": {"labels": {"app": "nginx2"}, "name": "foo",
|
||||||
|
"annotations": {"app": "nginx2", config.kubernetes.io/index: '0',
|
||||||
|
config.kubernetes.io/path: 'f1.json'}}, "spec": {"replicas": 1}}
|
||||||
|
`))
|
||||||
|
|
||||||
|
r.Command.SetOut(out)
|
||||||
|
r.Command.SetArgs([]string{})
|
||||||
|
if !assert.NoError(t, r.Command.Execute()) {
|
||||||
|
t.FailNow()
|
||||||
|
}
|
||||||
|
|
||||||
|
expected := `{
|
||||||
|
"kind": "Deployment",
|
||||||
|
"metadata": {
|
||||||
|
"annotations": {
|
||||||
|
"app": "nginx2"
|
||||||
|
},
|
||||||
|
"labels": {
|
||||||
|
"app": "nginx2"
|
||||||
|
},
|
||||||
|
"name": "foo"
|
||||||
|
},
|
||||||
|
"spec": {
|
||||||
|
"replicas": 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`
|
||||||
|
if !assert.Equal(t, expected, out.String()) {
|
||||||
|
println(out.String())
|
||||||
|
t.FailNow()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ func (r *SourceRunner) runE(c *cobra.Command, args []string) error {
|
|||||||
|
|
||||||
var inputs []kio.Reader
|
var inputs []kio.Reader
|
||||||
for _, a := range args {
|
for _, a := range args {
|
||||||
inputs = append(inputs, kio.LocalPackageReader{PackagePath: a})
|
inputs = append(inputs, kio.LocalPackageReader{PackagePath: a, MatchFilesGlob: kio.MatchAll})
|
||||||
}
|
}
|
||||||
if len(inputs) == 0 {
|
if len(inputs) == 0 {
|
||||||
inputs = []kio.Reader{&kio.ByteReader{Reader: c.InOrStdin()}}
|
inputs = []kio.Reader{&kio.ByteReader{Reader: c.InOrStdin()}}
|
||||||
|
|||||||
@@ -135,6 +135,77 @@ items:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestSourceCommandJSON(t *testing.T) {
|
||||||
|
d, err := ioutil.TempDir("", "kustomize-source-test")
|
||||||
|
if !assert.NoError(t, err) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
defer os.RemoveAll(d)
|
||||||
|
|
||||||
|
err = ioutil.WriteFile(filepath.Join(d, "f1.json"), []byte(`
|
||||||
|
{
|
||||||
|
"kind": "Deployment",
|
||||||
|
"metadata": {
|
||||||
|
"labels": {
|
||||||
|
"app": "nginx2"
|
||||||
|
},
|
||||||
|
"name": "foo",
|
||||||
|
"annotations": {
|
||||||
|
"app": "nginx2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"spec": {
|
||||||
|
"replicas": 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`), 0600)
|
||||||
|
if !assert.NoError(t, err) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = ioutil.WriteFile(filepath.Join(d, "f2.json"), []byte(`
|
||||||
|
{
|
||||||
|
"apiVersion": "v1",
|
||||||
|
"kind": "Abstraction",
|
||||||
|
"metadata": {
|
||||||
|
"name": "foo",
|
||||||
|
"annotations": {
|
||||||
|
"config.kubernetes.io/function": "container:\n image: gcr.io/example/reconciler:v1\n",
|
||||||
|
"config.kubernetes.io/local-config": "true"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"spec": {
|
||||||
|
"replicas": 3
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`), 0600)
|
||||||
|
if !assert.NoError(t, err) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// fmt the files
|
||||||
|
b := &bytes.Buffer{}
|
||||||
|
r := commands.GetSourceRunner("")
|
||||||
|
r.Command.SetArgs([]string{d})
|
||||||
|
r.Command.SetOut(b)
|
||||||
|
if !assert.NoError(t, r.Command.Execute()) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if !assert.Equal(t, `apiVersion: config.kubernetes.io/v1alpha1
|
||||||
|
kind: ResourceList
|
||||||
|
items:
|
||||||
|
- {"kind": "Deployment", "metadata": {"labels": {"app": "nginx2"}, "name": "foo",
|
||||||
|
"annotations": {"app": "nginx2", config.kubernetes.io/index: '0', config.kubernetes.io/path: 'f1.json'}},
|
||||||
|
"spec": {"replicas": 1}}
|
||||||
|
- {"apiVersion": "v1", "kind": "Abstraction", "metadata": {"name": "foo", "annotations": {
|
||||||
|
"config.kubernetes.io/function": "container:\n image: gcr.io/example/reconciler:v1\n",
|
||||||
|
"config.kubernetes.io/local-config": "true", config.kubernetes.io/index: '0',
|
||||||
|
config.kubernetes.io/path: 'f2.json'}}, "spec": {"replicas": 3}}
|
||||||
|
`, b.String()) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestSourceCommand_Stdin(t *testing.T) {
|
func TestSourceCommand_Stdin(t *testing.T) {
|
||||||
d, err := ioutil.TempDir("", "kustomize-source-test")
|
d, err := ioutil.TempDir("", "kustomize-source-test")
|
||||||
if !assert.NoError(t, err) {
|
if !assert.NoError(t, err) {
|
||||||
@@ -198,3 +269,48 @@ items:
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestSourceCommandJSON_Stdin(t *testing.T) {
|
||||||
|
d, err := ioutil.TempDir("", "kustomize-source-test")
|
||||||
|
if !assert.NoError(t, err) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
defer os.RemoveAll(d)
|
||||||
|
|
||||||
|
in := bytes.NewBufferString(`
|
||||||
|
{
|
||||||
|
"kind": "Deployment",
|
||||||
|
"metadata": {
|
||||||
|
"labels": {
|
||||||
|
"app": "nginx2"
|
||||||
|
},
|
||||||
|
"name": "foo",
|
||||||
|
"annotations": {
|
||||||
|
"app": "nginx2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"spec": {
|
||||||
|
"replicas": 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`)
|
||||||
|
|
||||||
|
out := &bytes.Buffer{}
|
||||||
|
r := commands.GetSourceRunner("")
|
||||||
|
r.Command.SetArgs([]string{})
|
||||||
|
r.Command.SetIn(in)
|
||||||
|
r.Command.SetOut(out)
|
||||||
|
if !assert.NoError(t, r.Command.Execute()) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if !assert.Equal(t, `apiVersion: config.kubernetes.io/v1alpha1
|
||||||
|
kind: ResourceList
|
||||||
|
items:
|
||||||
|
- {"kind": "Deployment", "metadata": {"labels": {"app": "nginx2"}, "name": "foo",
|
||||||
|
"annotations": {"app": "nginx2", config.kubernetes.io/index: '0'}}, "spec": {
|
||||||
|
"replicas": 1}}
|
||||||
|
`, out.String()) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -244,7 +244,7 @@ containers that can be chained together as part of a configuration management pi
|
|||||||
The end result of such a pipeline are fully rendered configurations that can then be
|
The end result of such a pipeline are fully rendered configurations that can then be
|
||||||
applied to a control plane (e.g. Using ‘kubectl apply’ for Kubernetes control plane).
|
applied to a control plane (e.g. Using ‘kubectl apply’ for Kubernetes control plane).
|
||||||
As such, although this document references Kubernetes Resource Model and API conventions,
|
As such, although this document references Kubernetes Resource Model and API conventions,
|
||||||
it is completely decoupled from Kuberentes API machinery and does not depend on any
|
it is completely decoupled from Kubernetes API machinery and does not depend on any
|
||||||
in-cluster components.
|
in-cluster components.
|
||||||
|
|
||||||
This document references terms described in [Kubernetes API Conventions][1].
|
This document references terms described in [Kubernetes API Conventions][1].
|
||||||
@@ -267,7 +267,7 @@ interpreted as described in [RFC 2119][2].
|
|||||||
Performing these on the client rather than the server enables:
|
Performing these on the client rather than the server enables:
|
||||||
|
|
||||||
- Configuration to be reviewed prior to being sent to the API server
|
- Configuration to be reviewed prior to being sent to the API server
|
||||||
- Configuration to be validated as part of the CI?CD pipeline
|
- Configuration to be validated as part of the CI/CD pipeline
|
||||||
- Configuration for Resources to validated holistically rather than individually
|
- Configuration for Resources to validated holistically rather than individually
|
||||||
per-Resource
|
per-Resource
|
||||||
- e.g. ensure the ` + "`" + `Service.selector` + "`" + ` and ` + "`" + `Deployment.spec.template` + "`" + ` labels
|
- e.g. ensure the ` + "`" + `Service.selector` + "`" + ` and ` + "`" + `Deployment.spec.template` + "`" + ` labels
|
||||||
|
|||||||
@@ -1,3 +1,2 @@
|
|||||||
English | [简体中文](zh/README.md)
|
|
||||||
|
|
||||||
Moved to [https://kubernetes-sigs.github.io/kustomize](https://kubernetes-sigs.github.io/kustomize)
|
Moved to [https://kubernetes-sigs.github.io/kustomize](https://kubernetes-sigs.github.io/kustomize)
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
<meta name="generator" content="Hugo 0.73.0-DEV" />
|
<meta name="generator" content="Hugo 0.73.0" />
|
||||||
|
|
||||||
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
||||||
|
|
||||||
@@ -99,6 +99,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link" href="https://github.com/kubernetes-sigs/kustomize/tree/master/examples" target="_blank" ><span>Example</span></a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item mr-4 mb-2 mb-lg-0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
||||||
@@ -126,6 +134,19 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="nav-item dropdown d-none d-lg-block">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/api-reference/glossary/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="navbar-nav d-none d-lg-block">
|
<div class="navbar-nav d-none d-lg-block">
|
||||||
@@ -153,6 +174,19 @@
|
|||||||
|
|
||||||
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
||||||
|
|
||||||
|
<div class="nav-item dropdown d-block d-lg-none">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/api-reference/glossary/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1012,7 +1046,7 @@ syntax. See this <a href="https://github.com/kubernetes-sigs/kustomize/tree/mas
|
|||||||
<p>A chunk of code used by kustomize, but not necessarily
|
<p>A chunk of code used by kustomize, but not necessarily
|
||||||
compiled into kustomize, to generate and/or transform a
|
compiled into kustomize, to generate and/or transform a
|
||||||
kubernetes resource as part of a kustomization.</p>
|
kubernetes resource as part of a kustomization.</p>
|
||||||
<p>Details <a href="plugins">here</a>.</p>
|
<p>Details <a href="../../guides/plugins">here</a>.</p>
|
||||||
<h2 id="resource">resource</h2>
|
<h2 id="resource">resource</h2>
|
||||||
<p>A <em>resource</em> in the context of a REST-ful API is the
|
<p>A <em>resource</em> in the context of a REST-ful API is the
|
||||||
target object of an HTTP operation like <em>GET</em>, <em>PUT</em> or
|
target object of an HTTP operation like <em>GET</em>, <em>PUT</em> or
|
||||||
@@ -1113,7 +1147,7 @@ cpu and memory requests.</p>
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="text-muted mt-5 pt-3 border-top">Last modified June 7, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/42497c664f619a36cc86156e366b53099bd633cb">Convert docs to docsy (42497c66)</a>
|
<div class="text-muted mt-5 pt-3 border-top">Last modified June 15, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/518147c129f831913d33226cf17068d0d4270f41">add zh docsy (518147c1)</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
<meta name="generator" content="Hugo 0.73.0-DEV" />
|
<meta name="generator" content="Hugo 0.73.0" />
|
||||||
|
|
||||||
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
||||||
|
|
||||||
@@ -99,6 +99,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link" href="https://github.com/kubernetes-sigs/kustomize/tree/master/examples" target="_blank" ><span>Example</span></a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item mr-4 mb-2 mb-lg-0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
||||||
@@ -126,6 +134,19 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="nav-item dropdown d-none d-lg-block">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/api-reference/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="navbar-nav d-none d-lg-block">
|
<div class="navbar-nav d-none d-lg-block">
|
||||||
@@ -153,6 +174,19 @@
|
|||||||
|
|
||||||
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
||||||
|
|
||||||
|
<div class="nav-item dropdown d-block d-lg-none">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/api-reference/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
<meta name="generator" content="Hugo 0.73.0-DEV" />
|
<meta name="generator" content="Hugo 0.73.0" />
|
||||||
|
|
||||||
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
||||||
|
|
||||||
@@ -99,6 +99,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link" href="https://github.com/kubernetes-sigs/kustomize/tree/master/examples" target="_blank" ><span>Example</span></a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item mr-4 mb-2 mb-lg-0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
||||||
@@ -126,6 +134,19 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="nav-item dropdown d-none d-lg-block">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/api-reference/kustomization/bases/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="navbar-nav d-none d-lg-block">
|
<div class="navbar-nav d-none d-lg-block">
|
||||||
@@ -153,6 +174,19 @@
|
|||||||
|
|
||||||
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
||||||
|
|
||||||
|
<div class="nav-item dropdown d-block d-lg-none">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/api-reference/kustomization/bases/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
<meta name="generator" content="Hugo 0.73.0-DEV" />
|
<meta name="generator" content="Hugo 0.73.0" />
|
||||||
|
|
||||||
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
||||||
|
|
||||||
@@ -99,6 +99,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link" href="https://github.com/kubernetes-sigs/kustomize/tree/master/examples" target="_blank" ><span>Example</span></a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item mr-4 mb-2 mb-lg-0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
||||||
@@ -126,6 +134,19 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="nav-item dropdown d-none d-lg-block">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/api-reference/kustomization/commonannotations/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="navbar-nav d-none d-lg-block">
|
<div class="navbar-nav d-none d-lg-block">
|
||||||
@@ -153,6 +174,19 @@
|
|||||||
|
|
||||||
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
||||||
|
|
||||||
|
<div class="nav-item dropdown d-block d-lg-none">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/api-reference/kustomization/commonannotations/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
<meta name="generator" content="Hugo 0.73.0-DEV" />
|
<meta name="generator" content="Hugo 0.73.0" />
|
||||||
|
|
||||||
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
||||||
|
|
||||||
@@ -99,6 +99,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link" href="https://github.com/kubernetes-sigs/kustomize/tree/master/examples" target="_blank" ><span>Example</span></a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item mr-4 mb-2 mb-lg-0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
||||||
@@ -126,6 +134,19 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="nav-item dropdown d-none d-lg-block">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/api-reference/kustomization/commonlabels/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="navbar-nav d-none d-lg-block">
|
<div class="navbar-nav d-none d-lg-block">
|
||||||
@@ -153,6 +174,19 @@
|
|||||||
|
|
||||||
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
||||||
|
|
||||||
|
<div class="nav-item dropdown d-block d-lg-none">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/api-reference/kustomization/commonlabels/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
<meta name="generator" content="Hugo 0.73.0-DEV" />
|
<meta name="generator" content="Hugo 0.73.0" />
|
||||||
|
|
||||||
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
||||||
|
|
||||||
@@ -99,6 +99,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link" href="https://github.com/kubernetes-sigs/kustomize/tree/master/examples" target="_blank" ><span>Example</span></a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item mr-4 mb-2 mb-lg-0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
||||||
@@ -126,6 +134,19 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="nav-item dropdown d-none d-lg-block">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/api-reference/kustomization/components/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="navbar-nav d-none d-lg-block">
|
<div class="navbar-nav d-none d-lg-block">
|
||||||
@@ -153,6 +174,19 @@
|
|||||||
|
|
||||||
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
||||||
|
|
||||||
|
<div class="nav-item dropdown d-block d-lg-none">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/api-reference/kustomization/components/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
<meta name="generator" content="Hugo 0.73.0-DEV" />
|
<meta name="generator" content="Hugo 0.73.0" />
|
||||||
|
|
||||||
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
||||||
|
|
||||||
@@ -99,6 +99,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link" href="https://github.com/kubernetes-sigs/kustomize/tree/master/examples" target="_blank" ><span>Example</span></a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item mr-4 mb-2 mb-lg-0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
||||||
@@ -126,6 +134,19 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="nav-item dropdown d-none d-lg-block">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/api-reference/kustomization/configmapgenerator/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="navbar-nav d-none d-lg-block">
|
<div class="navbar-nav d-none d-lg-block">
|
||||||
@@ -153,6 +174,19 @@
|
|||||||
|
|
||||||
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
||||||
|
|
||||||
|
<div class="nav-item dropdown d-block d-lg-none">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/api-reference/kustomization/configmapgenerator/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -714,9 +748,13 @@
|
|||||||
<div class="lead">Generate ConfigMap resources.</div>
|
<div class="lead">Generate ConfigMap resources.</div>
|
||||||
<p>Each entry in this list results in the creation of
|
<p>Each entry in this list results in the creation of
|
||||||
one ConfigMap resource (it’s a generator of n maps).</p>
|
one ConfigMap resource (it’s a generator of n maps).</p>
|
||||||
<p>The example below creates three ConfigMaps. One with the names and contents of
|
<p>The example below creates four ConfigMaps:</p>
|
||||||
the given files, one with key/value as data, and a third which sets an
|
<ul>
|
||||||
annotation and label via <code>options</code> for that single ConfigMap.</p>
|
<li>first, with the names and contents of the given files</li>
|
||||||
|
<li>second, with key/value as data using key/value pairs from files</li>
|
||||||
|
<li>third, also with key/value as data, directly specified using <code>literals</code></li>
|
||||||
|
<li>and a fourth, which sets an annotation and label via <code>options</code> for that single ConfigMap</li>
|
||||||
|
</ul>
|
||||||
<p>Each configMapGenerator item accepts a parameter of
|
<p>Each configMapGenerator item accepts a parameter of
|
||||||
<code>behavior: [create|replace|merge]</code>.
|
<code>behavior: [create|replace|merge]</code>.
|
||||||
This allows an overlay to modify or
|
This allows an overlay to modify or
|
||||||
@@ -746,8 +784,12 @@ trump any attempt to locally override it.</p>
|
|||||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">files</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">files</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- application.properties<span style="color:#f8f8f8;text-decoration:underline">
|
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- application.properties<span style="color:#f8f8f8;text-decoration:underline">
|
||||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- more.properties<span style="color:#f8f8f8;text-decoration:underline">
|
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- more.properties<span style="color:#f8f8f8;text-decoration:underline">
|
||||||
|
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span>my-java-server-env-file-vars<span style="color:#f8f8f8;text-decoration:underline">
|
||||||
|
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">envs</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||||
|
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- my-server-env.properties<span style="color:#f8f8f8;text-decoration:underline">
|
||||||
|
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- more-server-props.env<span style="color:#f8f8f8;text-decoration:underline">
|
||||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span>my-java-server-env-vars<span style="color:#f8f8f8;text-decoration:underline">
|
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span>my-java-server-env-vars<span style="color:#f8f8f8;text-decoration:underline">
|
||||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>literals<span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">literals</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- JAVA_HOME=/opt/java/jdk<span style="color:#f8f8f8;text-decoration:underline">
|
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- JAVA_HOME=/opt/java/jdk<span style="color:#f8f8f8;text-decoration:underline">
|
||||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- JAVA_TOOL_OPTIONS=-agentlib<span style="color:#000;font-weight:bold">:</span>hprof<span style="color:#f8f8f8;text-decoration:underline">
|
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- JAVA_TOOL_OPTIONS=-agentlib<span style="color:#000;font-weight:bold">:</span>hprof<span style="color:#f8f8f8;text-decoration:underline">
|
||||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">options</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">options</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
<meta name="generator" content="Hugo 0.73.0-DEV" />
|
<meta name="generator" content="Hugo 0.73.0" />
|
||||||
|
|
||||||
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
||||||
|
|
||||||
@@ -99,6 +99,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link" href="https://github.com/kubernetes-sigs/kustomize/tree/master/examples" target="_blank" ><span>Example</span></a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item mr-4 mb-2 mb-lg-0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
||||||
@@ -126,6 +134,19 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="nav-item dropdown d-none d-lg-block">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/api-reference/kustomization/crds/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="navbar-nav d-none d-lg-block">
|
<div class="navbar-nav d-none d-lg-block">
|
||||||
@@ -153,6 +174,19 @@
|
|||||||
|
|
||||||
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
||||||
|
|
||||||
|
<div class="nav-item dropdown d-block d-lg-none">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/api-reference/kustomization/crds/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
<meta name="generator" content="Hugo 0.73.0-DEV" />
|
<meta name="generator" content="Hugo 0.73.0" />
|
||||||
|
|
||||||
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
||||||
|
|
||||||
@@ -99,6 +99,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link" href="https://github.com/kubernetes-sigs/kustomize/tree/master/examples" target="_blank" ><span>Example</span></a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item mr-4 mb-2 mb-lg-0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
||||||
@@ -126,6 +134,19 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="nav-item dropdown d-none d-lg-block">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/api-reference/kustomization/generatoroptions/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="navbar-nav d-none d-lg-block">
|
<div class="navbar-nav d-none d-lg-block">
|
||||||
@@ -153,6 +174,19 @@
|
|||||||
|
|
||||||
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
||||||
|
|
||||||
|
<div class="nav-item dropdown d-block d-lg-none">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/api-reference/kustomization/generatoroptions/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -714,7 +748,7 @@
|
|||||||
<div class="lead">Control behavior of <a href="/kustomize/api-reference/kustomization/configmapgenerator">ConfigMap</a> and <a href="/kustomize/api-reference/kustomization/secretgenerator">Secret</a> generators.</div>
|
<div class="lead">Control behavior of <a href="/kustomize/api-reference/kustomization/configmapgenerator">ConfigMap</a> and <a href="/kustomize/api-reference/kustomization/secretgenerator">Secret</a> generators.</div>
|
||||||
<p>Additionally, generatorOptions can be set on a per resource level within each
|
<p>Additionally, generatorOptions can be set on a per resource level within each
|
||||||
generator. For details on per-resource generatorOptions usage see
|
generator. For details on per-resource generatorOptions usage see
|
||||||
[field-name-configMapGenerator] and See [field-name-secretGenerator].</p>
|
<a href="/kustomize/api-reference/kustomization/configmapgenerator">field-name-configMapGenerator</a> and See <a href="/kustomize/api-reference/kustomization/secretgenerator">field-name-secretGenerator</a>.</p>
|
||||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span>kustomize.config.k8s.io/v1beta1<span style="color:#f8f8f8;text-decoration:underline">
|
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span>kustomize.config.k8s.io/v1beta1<span style="color:#f8f8f8;text-decoration:underline">
|
||||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span>Kustomization<span style="color:#f8f8f8;text-decoration:underline">
|
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span>Kustomization<span style="color:#f8f8f8;text-decoration:underline">
|
||||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||||
@@ -784,7 +818,7 @@ generator. For details on per-resource generatorOptions usage see
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="text-muted mt-5 pt-3 border-top">Last modified June 7, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/42497c664f619a36cc86156e366b53099bd633cb">Convert docs to docsy (42497c66)</a>
|
<div class="text-muted mt-5 pt-3 border-top">Last modified June 15, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/518147c129f831913d33226cf17068d0d4270f41">add zh docsy (518147c1)</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
<meta name="generator" content="Hugo 0.73.0-DEV" />
|
<meta name="generator" content="Hugo 0.73.0" />
|
||||||
|
|
||||||
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
||||||
|
|
||||||
@@ -99,6 +99,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link" href="https://github.com/kubernetes-sigs/kustomize/tree/master/examples" target="_blank" ><span>Example</span></a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item mr-4 mb-2 mb-lg-0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
||||||
@@ -126,6 +134,19 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="nav-item dropdown d-none d-lg-block">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/api-reference/kustomization/images/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="navbar-nav d-none d-lg-block">
|
<div class="navbar-nav d-none d-lg-block">
|
||||||
@@ -153,6 +174,19 @@
|
|||||||
|
|
||||||
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
||||||
|
|
||||||
|
<div class="nav-item dropdown d-block d-lg-none">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/api-reference/kustomization/images/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
<meta name="generator" content="Hugo 0.73.0-DEV" />
|
<meta name="generator" content="Hugo 0.73.0" />
|
||||||
|
|
||||||
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
||||||
|
|
||||||
@@ -99,6 +99,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link" href="https://github.com/kubernetes-sigs/kustomize/tree/master/examples" target="_blank" ><span>Example</span></a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item mr-4 mb-2 mb-lg-0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
||||||
@@ -126,6 +134,19 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="nav-item dropdown d-none d-lg-block">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/api-reference/kustomization/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="navbar-nav d-none d-lg-block">
|
<div class="navbar-nav d-none d-lg-block">
|
||||||
@@ -153,6 +174,19 @@
|
|||||||
|
|
||||||
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
||||||
|
|
||||||
|
<div class="nav-item dropdown d-block d-lg-none">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/api-reference/kustomization/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -199,9 +199,13 @@ resource has been applied to a cluster.</p>
|
|||||||
|
|
||||||
<p>Each entry in this list results in the creation of
|
<p>Each entry in this list results in the creation of
|
||||||
one ConfigMap resource (it&rsquo;s a generator of n maps).</p>
|
one ConfigMap resource (it&rsquo;s a generator of n maps).</p>
|
||||||
<p>The example below creates three ConfigMaps. One with the names and contents of
|
<p>The example below creates four ConfigMaps:</p>
|
||||||
the given files, one with key/value as data, and a third which sets an
|
<ul>
|
||||||
annotation and label via <code>options</code> for that single ConfigMap.</p>
|
<li>first, with the names and contents of the given files</li>
|
||||||
|
<li>second, with key/value as data using key/value pairs from files</li>
|
||||||
|
<li>third, also with key/value as data, directly specified using <code>literals</code></li>
|
||||||
|
<li>and a fourth, which sets an annotation and label via <code>options</code> for that single ConfigMap</li>
|
||||||
|
</ul>
|
||||||
<p>Each configMapGenerator item accepts a parameter of
|
<p>Each configMapGenerator item accepts a parameter of
|
||||||
<code>behavior: [create|replace|merge]</code>.
|
<code>behavior: [create|replace|merge]</code>.
|
||||||
This allows an overlay to modify or
|
This allows an overlay to modify or
|
||||||
@@ -231,8 +235,12 @@ trump any attempt to locally override it.</p>
|
|||||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">files</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">files</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- application.properties<span style="color:#f8f8f8;text-decoration:underline">
|
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- application.properties<span style="color:#f8f8f8;text-decoration:underline">
|
||||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- more.properties<span style="color:#f8f8f8;text-decoration:underline">
|
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- more.properties<span style="color:#f8f8f8;text-decoration:underline">
|
||||||
|
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span>my-java-server-env-file-vars<span style="color:#f8f8f8;text-decoration:underline">
|
||||||
|
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">envs</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||||
|
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- my-server-env.properties<span style="color:#f8f8f8;text-decoration:underline">
|
||||||
|
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- more-server-props.env<span style="color:#f8f8f8;text-decoration:underline">
|
||||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span>my-java-server-env-vars<span style="color:#f8f8f8;text-decoration:underline">
|
</span><span style="color:#f8f8f8;text-decoration:underline"></span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span>my-java-server-env-vars<span style="color:#f8f8f8;text-decoration:underline">
|
||||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>literals<span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">literals</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- JAVA_HOME=/opt/java/jdk<span style="color:#f8f8f8;text-decoration:underline">
|
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- JAVA_HOME=/opt/java/jdk<span style="color:#f8f8f8;text-decoration:underline">
|
||||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- JAVA_TOOL_OPTIONS=-agentlib<span style="color:#000;font-weight:bold">:</span>hprof<span style="color:#f8f8f8;text-decoration:underline">
|
</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- JAVA_TOOL_OPTIONS=-agentlib<span style="color:#000;font-weight:bold">:</span>hprof<span style="color:#f8f8f8;text-decoration:underline">
|
||||||
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">options</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">options</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||||
@@ -316,7 +324,7 @@ same way.</p>
|
|||||||
|
|
||||||
<p>Additionally, generatorOptions can be set on a per resource level within each
|
<p>Additionally, generatorOptions can be set on a per resource level within each
|
||||||
generator. For details on per-resource generatorOptions usage see
|
generator. For details on per-resource generatorOptions usage see
|
||||||
[field-name-configMapGenerator] and See [field-name-secretGenerator].</p>
|
<a href="https://kubernetes-sigs.github.io/kustomize/kustomize/api-reference/kustomization/configmapgenerator">field-name-configMapGenerator</a> and See <a href="https://kubernetes-sigs.github.io/kustomize/kustomize/api-reference/kustomization/secretgenerator">field-name-secretGenerator</a>.</p>
|
||||||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span>kustomize.config.k8s.io/v1beta1<span style="color:#f8f8f8;text-decoration:underline">
|
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span>kustomize.config.k8s.io/v1beta1<span style="color:#f8f8f8;text-decoration:underline">
|
||||||
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span>Kustomization<span style="color:#f8f8f8;text-decoration:underline">
|
</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span>Kustomization<span style="color:#f8f8f8;text-decoration:underline">
|
||||||
</span><span style="color:#f8f8f8;text-decoration:underline">
|
</span><span style="color:#f8f8f8;text-decoration:underline">
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
<meta name="generator" content="Hugo 0.73.0-DEV" />
|
<meta name="generator" content="Hugo 0.73.0" />
|
||||||
|
|
||||||
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
||||||
|
|
||||||
@@ -99,6 +99,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link" href="https://github.com/kubernetes-sigs/kustomize/tree/master/examples" target="_blank" ><span>Example</span></a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item mr-4 mb-2 mb-lg-0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
||||||
@@ -126,6 +134,19 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="nav-item dropdown d-none d-lg-block">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/api-reference/kustomization/nameprefix/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="navbar-nav d-none d-lg-block">
|
<div class="navbar-nav d-none d-lg-block">
|
||||||
@@ -153,6 +174,19 @@
|
|||||||
|
|
||||||
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
||||||
|
|
||||||
|
<div class="nav-item dropdown d-block d-lg-none">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/api-reference/kustomization/nameprefix/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
<meta name="generator" content="Hugo 0.73.0-DEV" />
|
<meta name="generator" content="Hugo 0.73.0" />
|
||||||
|
|
||||||
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
||||||
|
|
||||||
@@ -99,6 +99,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link" href="https://github.com/kubernetes-sigs/kustomize/tree/master/examples" target="_blank" ><span>Example</span></a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item mr-4 mb-2 mb-lg-0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
||||||
@@ -126,6 +134,19 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="nav-item dropdown d-none d-lg-block">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/api-reference/kustomization/namespace/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="navbar-nav d-none d-lg-block">
|
<div class="navbar-nav d-none d-lg-block">
|
||||||
@@ -153,6 +174,19 @@
|
|||||||
|
|
||||||
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
||||||
|
|
||||||
|
<div class="nav-item dropdown d-block d-lg-none">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/api-reference/kustomization/namespace/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
<meta name="generator" content="Hugo 0.73.0-DEV" />
|
<meta name="generator" content="Hugo 0.73.0" />
|
||||||
|
|
||||||
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
||||||
|
|
||||||
@@ -99,6 +99,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link" href="https://github.com/kubernetes-sigs/kustomize/tree/master/examples" target="_blank" ><span>Example</span></a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item mr-4 mb-2 mb-lg-0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
||||||
@@ -126,6 +134,19 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="nav-item dropdown d-none d-lg-block">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/api-reference/kustomization/namesuffix/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="navbar-nav d-none d-lg-block">
|
<div class="navbar-nav d-none d-lg-block">
|
||||||
@@ -153,6 +174,19 @@
|
|||||||
|
|
||||||
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
||||||
|
|
||||||
|
<div class="nav-item dropdown d-block d-lg-none">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/api-reference/kustomization/namesuffix/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
<meta name="generator" content="Hugo 0.73.0-DEV" />
|
<meta name="generator" content="Hugo 0.73.0" />
|
||||||
|
|
||||||
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
||||||
|
|
||||||
@@ -99,6 +99,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link" href="https://github.com/kubernetes-sigs/kustomize/tree/master/examples" target="_blank" ><span>Example</span></a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item mr-4 mb-2 mb-lg-0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
||||||
@@ -126,6 +134,19 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="nav-item dropdown d-none d-lg-block">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/api-reference/kustomization/patches/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="navbar-nav d-none d-lg-block">
|
<div class="navbar-nav d-none d-lg-block">
|
||||||
@@ -153,6 +174,19 @@
|
|||||||
|
|
||||||
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
||||||
|
|
||||||
|
<div class="nav-item dropdown d-block d-lg-none">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/api-reference/kustomization/patches/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
<meta name="generator" content="Hugo 0.73.0-DEV" />
|
<meta name="generator" content="Hugo 0.73.0" />
|
||||||
|
|
||||||
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
||||||
|
|
||||||
@@ -99,6 +99,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link" href="https://github.com/kubernetes-sigs/kustomize/tree/master/examples" target="_blank" ><span>Example</span></a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item mr-4 mb-2 mb-lg-0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
||||||
@@ -126,6 +134,19 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="nav-item dropdown d-none d-lg-block">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/api-reference/kustomization/patchesjson6902/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="navbar-nav d-none d-lg-block">
|
<div class="navbar-nav d-none d-lg-block">
|
||||||
@@ -153,6 +174,19 @@
|
|||||||
|
|
||||||
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
||||||
|
|
||||||
|
<div class="nav-item dropdown d-block d-lg-none">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/api-reference/kustomization/patchesjson6902/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
<meta name="generator" content="Hugo 0.73.0-DEV" />
|
<meta name="generator" content="Hugo 0.73.0" />
|
||||||
|
|
||||||
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
||||||
|
|
||||||
@@ -99,6 +99,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link" href="https://github.com/kubernetes-sigs/kustomize/tree/master/examples" target="_blank" ><span>Example</span></a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item mr-4 mb-2 mb-lg-0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
||||||
@@ -126,6 +134,19 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="nav-item dropdown d-none d-lg-block">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/api-reference/kustomization/patchesstrategicmerge/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="navbar-nav d-none d-lg-block">
|
<div class="navbar-nav d-none d-lg-block">
|
||||||
@@ -153,6 +174,19 @@
|
|||||||
|
|
||||||
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
||||||
|
|
||||||
|
<div class="nav-item dropdown d-block d-lg-none">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/api-reference/kustomization/patchesstrategicmerge/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
<meta name="generator" content="Hugo 0.73.0-DEV" />
|
<meta name="generator" content="Hugo 0.73.0" />
|
||||||
|
|
||||||
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
||||||
|
|
||||||
@@ -99,6 +99,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link" href="https://github.com/kubernetes-sigs/kustomize/tree/master/examples" target="_blank" ><span>Example</span></a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item mr-4 mb-2 mb-lg-0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
||||||
@@ -126,6 +134,19 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="nav-item dropdown d-none d-lg-block">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/api-reference/kustomization/replicas/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="navbar-nav d-none d-lg-block">
|
<div class="navbar-nav d-none d-lg-block">
|
||||||
@@ -153,6 +174,19 @@
|
|||||||
|
|
||||||
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
||||||
|
|
||||||
|
<div class="nav-item dropdown d-block d-lg-none">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/api-reference/kustomization/replicas/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
<meta name="generator" content="Hugo 0.73.0-DEV" />
|
<meta name="generator" content="Hugo 0.73.0" />
|
||||||
|
|
||||||
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
||||||
|
|
||||||
@@ -99,6 +99,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link" href="https://github.com/kubernetes-sigs/kustomize/tree/master/examples" target="_blank" ><span>Example</span></a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item mr-4 mb-2 mb-lg-0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
||||||
@@ -126,6 +134,19 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="nav-item dropdown d-none d-lg-block">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/api-reference/kustomization/resources/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="navbar-nav d-none d-lg-block">
|
<div class="navbar-nav d-none d-lg-block">
|
||||||
@@ -153,6 +174,19 @@
|
|||||||
|
|
||||||
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
||||||
|
|
||||||
|
<div class="nav-item dropdown d-block d-lg-none">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/api-reference/kustomization/resources/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
<meta name="generator" content="Hugo 0.73.0-DEV" />
|
<meta name="generator" content="Hugo 0.73.0" />
|
||||||
|
|
||||||
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
||||||
|
|
||||||
@@ -99,6 +99,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link" href="https://github.com/kubernetes-sigs/kustomize/tree/master/examples" target="_blank" ><span>Example</span></a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item mr-4 mb-2 mb-lg-0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
||||||
@@ -126,6 +134,19 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="nav-item dropdown d-none d-lg-block">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/api-reference/kustomization/secretegenerator/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="navbar-nav d-none d-lg-block">
|
<div class="navbar-nav d-none d-lg-block">
|
||||||
@@ -153,6 +174,19 @@
|
|||||||
|
|
||||||
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
||||||
|
|
||||||
|
<div class="nav-item dropdown d-block d-lg-none">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/api-reference/kustomization/secretegenerator/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
<meta name="generator" content="Hugo 0.73.0-DEV" />
|
<meta name="generator" content="Hugo 0.73.0" />
|
||||||
|
|
||||||
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
||||||
|
|
||||||
@@ -99,6 +99,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link" href="https://github.com/kubernetes-sigs/kustomize/tree/master/examples" target="_blank" ><span>Example</span></a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item mr-4 mb-2 mb-lg-0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
||||||
@@ -126,6 +134,19 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="nav-item dropdown d-none d-lg-block">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/api-reference/kustomization/vars/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="navbar-nav d-none d-lg-block">
|
<div class="navbar-nav d-none d-lg-block">
|
||||||
@@ -153,6 +174,19 @@
|
|||||||
|
|
||||||
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
||||||
|
|
||||||
|
<div class="nav-item dropdown d-block d-lg-none">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/api-reference/kustomization/vars/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
<meta name="generator" content="Hugo 0.73.0-DEV" />
|
<meta name="generator" content="Hugo 0.73.0" />
|
||||||
|
|
||||||
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
||||||
|
|
||||||
@@ -106,6 +106,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link" href="https://github.com/kubernetes-sigs/kustomize/tree/master/examples" target="_blank" ><span>Example</span></a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item mr-4 mb-2 mb-lg-0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
||||||
@@ -133,6 +141,19 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="nav-item dropdown d-none d-lg-block">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/blog/2018/05/21/v1.0.1/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="navbar-nav d-none d-lg-block">
|
<div class="navbar-nav d-none d-lg-block">
|
||||||
@@ -160,6 +181,19 @@
|
|||||||
|
|
||||||
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
||||||
|
|
||||||
|
<div class="nav-item dropdown d-block d-lg-none">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/blog/2018/05/21/v1.0.1/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
<meta name="generator" content="Hugo 0.73.0-DEV" />
|
<meta name="generator" content="Hugo 0.73.0" />
|
||||||
|
|
||||||
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
||||||
|
|
||||||
@@ -106,6 +106,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link" href="https://github.com/kubernetes-sigs/kustomize/tree/master/examples" target="_blank" ><span>Example</span></a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item mr-4 mb-2 mb-lg-0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
||||||
@@ -133,6 +141,19 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="nav-item dropdown d-none d-lg-block">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/blog/2019/02/05/v2.0.0/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="navbar-nav d-none d-lg-block">
|
<div class="navbar-nav d-none d-lg-block">
|
||||||
@@ -160,6 +181,19 @@
|
|||||||
|
|
||||||
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
||||||
|
|
||||||
|
<div class="nav-item dropdown d-block d-lg-none">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/blog/2019/02/05/v2.0.0/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
<meta name="generator" content="Hugo 0.73.0-DEV" />
|
<meta name="generator" content="Hugo 0.73.0" />
|
||||||
|
|
||||||
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
||||||
|
|
||||||
@@ -106,6 +106,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link" href="https://github.com/kubernetes-sigs/kustomize/tree/master/examples" target="_blank" ><span>Example</span></a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item mr-4 mb-2 mb-lg-0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
||||||
@@ -133,6 +141,19 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="nav-item dropdown d-none d-lg-block">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/blog/2019/06/18/v2.1.0/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="navbar-nav d-none d-lg-block">
|
<div class="navbar-nav d-none d-lg-block">
|
||||||
@@ -160,6 +181,19 @@
|
|||||||
|
|
||||||
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
||||||
|
|
||||||
|
<div class="nav-item dropdown d-block d-lg-none">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/blog/2019/06/18/v2.1.0/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
<meta name="generator" content="Hugo 0.73.0-DEV" />
|
<meta name="generator" content="Hugo 0.73.0" />
|
||||||
|
|
||||||
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
||||||
|
|
||||||
@@ -106,6 +106,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link" href="https://github.com/kubernetes-sigs/kustomize/tree/master/examples" target="_blank" ><span>Example</span></a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item mr-4 mb-2 mb-lg-0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
||||||
@@ -133,6 +141,19 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="nav-item dropdown d-none d-lg-block">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/blog/2019/07/03/v3.0.0/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="navbar-nav d-none d-lg-block">
|
<div class="navbar-nav d-none d-lg-block">
|
||||||
@@ -160,6 +181,19 @@
|
|||||||
|
|
||||||
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
||||||
|
|
||||||
|
<div class="nav-item dropdown d-block d-lg-none">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/blog/2019/07/03/v3.0.0/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
<meta name="generator" content="Hugo 0.73.0-DEV" />
|
<meta name="generator" content="Hugo 0.73.0" />
|
||||||
|
|
||||||
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
||||||
|
|
||||||
@@ -106,6 +106,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link" href="https://github.com/kubernetes-sigs/kustomize/tree/master/examples" target="_blank" ><span>Example</span></a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item mr-4 mb-2 mb-lg-0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
||||||
@@ -133,6 +141,19 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="nav-item dropdown d-none d-lg-block">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/blog/2019/07/26/v3.1.0/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="navbar-nav d-none d-lg-block">
|
<div class="navbar-nav d-none d-lg-block">
|
||||||
@@ -160,6 +181,19 @@
|
|||||||
|
|
||||||
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
||||||
|
|
||||||
|
<div class="nav-item dropdown d-block d-lg-none">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/blog/2019/07/26/v3.1.0/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
<meta name="generator" content="Hugo 0.73.0-DEV" />
|
<meta name="generator" content="Hugo 0.73.0" />
|
||||||
|
|
||||||
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
||||||
|
|
||||||
@@ -106,6 +106,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link" href="https://github.com/kubernetes-sigs/kustomize/tree/master/examples" target="_blank" ><span>Example</span></a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item mr-4 mb-2 mb-lg-0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
||||||
@@ -133,6 +141,19 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="nav-item dropdown d-none d-lg-block">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/blog/2019/09/17/v3.2.0/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="navbar-nav d-none d-lg-block">
|
<div class="navbar-nav d-none d-lg-block">
|
||||||
@@ -160,6 +181,19 @@
|
|||||||
|
|
||||||
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
||||||
|
|
||||||
|
<div class="nav-item dropdown d-block d-lg-none">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/blog/2019/09/17/v3.2.0/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
<meta name="generator" content="Hugo 0.73.0-DEV" />
|
<meta name="generator" content="Hugo 0.73.0" />
|
||||||
|
|
||||||
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
||||||
|
|
||||||
@@ -106,6 +106,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link" href="https://github.com/kubernetes-sigs/kustomize/tree/master/examples" target="_blank" ><span>Example</span></a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item mr-4 mb-2 mb-lg-0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
||||||
@@ -133,6 +141,19 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="nav-item dropdown d-none d-lg-block">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/blog/2019/09/26/v3.2.1/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="navbar-nav d-none d-lg-block">
|
<div class="navbar-nav d-none d-lg-block">
|
||||||
@@ -160,6 +181,19 @@
|
|||||||
|
|
||||||
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
||||||
|
|
||||||
|
<div class="nav-item dropdown d-block d-lg-none">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/blog/2019/09/26/v3.2.1/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
<meta name="generator" content="Hugo 0.73.0-DEV" />
|
<meta name="generator" content="Hugo 0.73.0" />
|
||||||
|
|
||||||
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
||||||
|
|
||||||
@@ -106,6 +106,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link" href="https://github.com/kubernetes-sigs/kustomize/tree/master/examples" target="_blank" ><span>Example</span></a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item mr-4 mb-2 mb-lg-0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
||||||
@@ -133,6 +141,19 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="nav-item dropdown d-none d-lg-block">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/blog/2019/10/24/v3.3.0/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="navbar-nav d-none d-lg-block">
|
<div class="navbar-nav d-none d-lg-block">
|
||||||
@@ -160,6 +181,19 @@
|
|||||||
|
|
||||||
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
||||||
|
|
||||||
|
<div class="nav-item dropdown d-block d-lg-none">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/blog/2019/10/24/v3.3.0/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
<meta name="generator" content="Hugo 0.73.0-DEV" />
|
<meta name="generator" content="Hugo 0.73.0" />
|
||||||
|
|
||||||
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
||||||
|
|
||||||
@@ -96,6 +96,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link" href="https://github.com/kubernetes-sigs/kustomize/tree/master/examples" target="_blank" ><span>Example</span></a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item mr-4 mb-2 mb-lg-0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
||||||
@@ -123,6 +131,19 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="nav-item dropdown d-none d-lg-block">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/blog/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="navbar-nav d-none d-lg-block">
|
<div class="navbar-nav d-none d-lg-block">
|
||||||
@@ -150,6 +171,19 @@
|
|||||||
|
|
||||||
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
||||||
|
|
||||||
|
<div class="nav-item dropdown d-block d-lg-none">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/blog/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
<meta name="generator" content="Hugo 0.73.0-DEV" />
|
<meta name="generator" content="Hugo 0.73.0" />
|
||||||
|
|
||||||
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
||||||
|
|
||||||
@@ -96,6 +96,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link" href="https://github.com/kubernetes-sigs/kustomize/tree/master/examples" target="_blank" ><span>Example</span></a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item mr-4 mb-2 mb-lg-0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
||||||
@@ -123,6 +131,19 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="nav-item dropdown d-none d-lg-block">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/blog/releases/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="navbar-nav d-none d-lg-block">
|
<div class="navbar-nav d-none d-lg-block">
|
||||||
@@ -150,6 +171,19 @@
|
|||||||
|
|
||||||
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
||||||
|
|
||||||
|
<div class="nav-item dropdown d-block d-lg-none">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/blog/releases/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
<meta name="generator" content="Hugo 0.73.0-DEV" />
|
<meta name="generator" content="Hugo 0.73.0" />
|
||||||
|
|
||||||
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
||||||
|
|
||||||
@@ -99,6 +99,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link" href="https://github.com/kubernetes-sigs/kustomize/tree/master/examples" target="_blank" ><span>Example</span></a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item mr-4 mb-2 mb-lg-0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
||||||
@@ -126,6 +134,19 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="nav-item dropdown d-none d-lg-block">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/contributing/bugs/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="navbar-nav d-none d-lg-block">
|
<div class="navbar-nav d-none d-lg-block">
|
||||||
@@ -153,6 +174,19 @@
|
|||||||
|
|
||||||
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
||||||
|
|
||||||
|
<div class="nav-item dropdown d-block d-lg-none">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/contributing/bugs/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -465,7 +499,7 @@ misunderstandings.</p>
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="text-muted mt-5 pt-3 border-top">Last modified June 14, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/1f28681af4176a6d97fdf286da0bd2b8d46c57ee">Add more Kustomize contributing docs (1f28681a)</a>
|
<div class="text-muted mt-5 pt-3 border-top">Last modified June 14, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/c4518e964fd88aa4e3495ef84141c876a9500f48">Add more Kustomize contributing docs (c4518e96)</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
<meta name="generator" content="Hugo 0.73.0-DEV" />
|
<meta name="generator" content="Hugo 0.73.0" />
|
||||||
|
|
||||||
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
||||||
|
|
||||||
@@ -99,6 +99,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link" href="https://github.com/kubernetes-sigs/kustomize/tree/master/examples" target="_blank" ><span>Example</span></a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item mr-4 mb-2 mb-lg-0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
||||||
@@ -126,6 +134,19 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="nav-item dropdown d-none d-lg-block">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/contributing/community/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="navbar-nav d-none d-lg-block">
|
<div class="navbar-nav d-none d-lg-block">
|
||||||
@@ -153,6 +174,19 @@
|
|||||||
|
|
||||||
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
||||||
|
|
||||||
|
<div class="nav-item dropdown d-block d-lg-none">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/contributing/community/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -440,7 +474,7 @@ project <a href="https://github.com/kubernetes/community/blob/master/community-m
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="text-muted mt-5 pt-3 border-top">Last modified June 14, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/1f28681af4176a6d97fdf286da0bd2b8d46c57ee">Add more Kustomize contributing docs (1f28681a)</a>
|
<div class="text-muted mt-5 pt-3 border-top">Last modified June 14, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/c4518e964fd88aa4e3495ef84141c876a9500f48">Add more Kustomize contributing docs (c4518e96)</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
<meta name="generator" content="Hugo 0.73.0-DEV" />
|
<meta name="generator" content="Hugo 0.73.0" />
|
||||||
|
|
||||||
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
||||||
|
|
||||||
@@ -99,6 +99,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link" href="https://github.com/kubernetes-sigs/kustomize/tree/master/examples" target="_blank" ><span>Example</span></a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item mr-4 mb-2 mb-lg-0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
||||||
@@ -126,6 +134,19 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="nav-item dropdown d-none d-lg-block">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/contributing/docs/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="navbar-nav d-none d-lg-block">
|
<div class="navbar-nav d-none d-lg-block">
|
||||||
@@ -153,6 +174,19 @@
|
|||||||
|
|
||||||
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
||||||
|
|
||||||
|
<div class="nav-item dropdown d-block d-lg-none">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/contributing/docs/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
<meta name="generator" content="Hugo 0.73.0-DEV" />
|
<meta name="generator" content="Hugo 0.73.0" />
|
||||||
|
|
||||||
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
|
||||||
|
|
||||||
@@ -99,6 +99,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link" href="https://github.com/kubernetes-sigs/kustomize/tree/master/examples" target="_blank" ><span>Example</span></a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item mr-4 mb-2 mb-lg-0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
<a class="nav-link" href="/kustomize/faq/" ><span>FAQ</span></a>
|
||||||
@@ -126,6 +134,19 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="nav-item dropdown d-none d-lg-block">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/contributing/features/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="navbar-nav d-none d-lg-block">
|
<div class="navbar-nav d-none d-lg-block">
|
||||||
@@ -153,6 +174,19 @@
|
|||||||
|
|
||||||
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
<nav class="collapse td-sidebar-nav pt-2 pl-4" id="td-section-nav">
|
||||||
|
|
||||||
|
<div class="nav-item dropdown d-block d-lg-none">
|
||||||
|
|
||||||
|
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
|
||||||
|
<a class="dropdown-item" href="/kustomize/zh/contributing/features/">简体中文</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -465,7 +499,7 @@ or more information is needed.</li>
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="text-muted mt-5 pt-3 border-top">Last modified June 14, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/1f28681af4176a6d97fdf286da0bd2b8d46c57ee">Add more Kustomize contributing docs (1f28681a)</a>
|
<div class="text-muted mt-5 pt-3 border-top">Last modified June 14, 2020: <a href="https://github.com/kubernetes-sigs/kustomize/commit/c4518e964fd88aa4e3495ef84141c876a9500f48">Add more Kustomize contributing docs (c4518e96)</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user