mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-11 17:12:51 +00:00
Spelling nits.
This commit is contained in:
@@ -21,7 +21,7 @@ package patch
|
|||||||
// https://github.com/kubernetes/community/blob/master/contributors/devel/strategic-merge-patch.md
|
// https://github.com/kubernetes/community/blob/master/contributors/devel/strategic-merge-patch.md
|
||||||
type StrategicMerge string
|
type StrategicMerge string
|
||||||
|
|
||||||
// Append appends a slice of patch paths to a PatchStategicMerge slice
|
// Append appends a slice of patch paths to a StrategicMerge slice
|
||||||
func Append(patches []StrategicMerge, paths ...string) []StrategicMerge {
|
func Append(patches []StrategicMerge, paths ...string) []StrategicMerge {
|
||||||
for _, p := range paths {
|
for _, p := range paths {
|
||||||
patches = append(patches, StrategicMerge(p))
|
patches = append(patches, StrategicMerge(p))
|
||||||
@@ -29,7 +29,7 @@ func Append(patches []StrategicMerge, paths ...string) []StrategicMerge {
|
|||||||
return patches
|
return patches
|
||||||
}
|
}
|
||||||
|
|
||||||
// Exist determines if a patch path exists in a slice of PatchStategicMerge
|
// Exist determines if a patch path exists in a slice of StrategicMerge
|
||||||
func Exist(patches []StrategicMerge, path string) bool {
|
func Exist(patches []StrategicMerge, path string) bool {
|
||||||
for _, p := range patches {
|
for _, p := range patches {
|
||||||
if p == StrategicMerge(path) {
|
if p == StrategicMerge(path) {
|
||||||
|
|||||||
@@ -206,11 +206,11 @@ func TestResources1(t *testing.T) {
|
|||||||
fakeFs.Mkdir("/")
|
fakeFs.Mkdir("/")
|
||||||
kt, err := NewKustTarget(l, fakeFs, transformerconfig.MakeDefaultTransformerConfig())
|
kt, err := NewKustTarget(l, fakeFs, transformerconfig.MakeDefaultTransformerConfig())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Unexpected construction error %v", err)
|
t.Fatalf("unexpected construction error %v", err)
|
||||||
}
|
}
|
||||||
actual, err := kt.MakeCustomizedResMap()
|
actual, err := kt.MakeCustomizedResMap()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Unexpected Resources error %v", err)
|
t.Fatalf("unexpected Resources error %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if !reflect.DeepEqual(actual, expected) {
|
if !reflect.DeepEqual(actual, expected) {
|
||||||
@@ -236,7 +236,7 @@ func TestResourceNotFound(t *testing.T) {
|
|||||||
t.Fatalf("Didn't get the expected error for an unknown resource")
|
t.Fatalf("Didn't get the expected error for an unknown resource")
|
||||||
}
|
}
|
||||||
if !strings.Contains(err.Error(), `cannot read file "/testpath/deployment.yaml"`) {
|
if !strings.Contains(err.Error(), `cannot read file "/testpath/deployment.yaml"`) {
|
||||||
t.Fatalf("Unpexpected error message %q", err)
|
t.Fatalf("unexpected error: %q", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -257,6 +257,6 @@ func TestSecretTimeout(t *testing.T) {
|
|||||||
t.Fatalf("Didn't get the expected error for an unknown resource")
|
t.Fatalf("Didn't get the expected error for an unknown resource")
|
||||||
}
|
}
|
||||||
if !strings.Contains(err.Error(), "killed") {
|
if !strings.Contains(err.Error(), "killed") {
|
||||||
t.Fatalf("Unpexpected error message %q", err)
|
t.Fatalf("unexpected error: %q", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ func (pt *patchTransformer) Transform(baseResourceMap resmap.ResMap) error {
|
|||||||
// Use Strategic-Merge-Patch to handle types w/ schema
|
// Use Strategic-Merge-Patch to handle types w/ schema
|
||||||
// TODO: Change this to use the new Merge package.
|
// TODO: Change this to use the new Merge package.
|
||||||
// Store the name of the base object, because this name may have been munged.
|
// Store the name of the base object, because this name may have been munged.
|
||||||
// Apply this name to the StrategicMergePatched object.
|
// Apply this name to the patched object.
|
||||||
lookupPatchMeta, err := strategicpatch.NewPatchMetaFromStruct(versionedObj)
|
lookupPatchMeta, err := strategicpatch.NewPatchMetaFromStruct(versionedObj)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ type Kustomization struct {
|
|||||||
// An Patch entry is very similar to an Resource entry.
|
// An Patch entry is very similar to an Resource entry.
|
||||||
// It specifies the relative paths for patch files within the package.
|
// It specifies the relative paths for patch files within the package.
|
||||||
// URLs and globs are not supported.
|
// URLs and globs are not supported.
|
||||||
// The patch files should be Stategic Merge Patch, the default patching behavior for kubectl.
|
// The patch files should be Strategic Merge Patch, the default patching behavior for kubectl.
|
||||||
// https://github.com/kubernetes/community/blob/master/contributors/devel/strategic-merge-patch.md
|
// https://github.com/kubernetes/community/blob/master/contributors/devel/strategic-merge-patch.md
|
||||||
Patches []string `json:"patches,omitempty" yaml:"patches,omitempty"`
|
Patches []string `json:"patches,omitempty" yaml:"patches,omitempty"`
|
||||||
PatchesStrategicMerge []patch.StrategicMerge `json:"patchesStrategicMerge,omitempty" yaml:"patchesStrategicMerge,omitempty"`
|
PatchesStrategicMerge []patch.StrategicMerge `json:"patchesStrategicMerge,omitempty" yaml:"patchesStrategicMerge,omitempty"`
|
||||||
|
|||||||
Reference in New Issue
Block a user