Skip to content

Commit 3081430

Browse files
monopoleLiujingfang1
authored andcommitted
Fix some minor naming mistakes. (#434)
* Fix some minor naming mistakes. * Fix some minor naming mistakes.
1 parent fd3cd64 commit 3081430

22 files changed

+29
-29
lines changed

internal/k8sdeps/kunstructuredfactory.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ type KunstructurerFactoryImpl struct {
2929

3030
var _ ifc.KunstructuredFactory = &KunstructurerFactoryImpl{}
3131

32-
// NewKustKunstructuredFactory returns a factory.
33-
func NewKustKunstructuredFactory(d ifc.Decoder) ifc.KunstructuredFactory {
32+
// NewKunstructuredFactoryImpl returns a factory.
33+
func NewKunstructuredFactoryImpl(d ifc.Decoder) ifc.KunstructuredFactory {
3434
return &KunstructurerFactoryImpl{decoder: d}
3535
}
3636

internal/k8sdeps/kunstructuredfactory_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
)
2525

2626
func TestSliceFromBytes(t *testing.T) {
27-
factory := NewKustKunstructuredFactory(NewKustDecoder())
27+
factory := NewKunstructuredFactoryImpl(NewKustDecoder())
2828
testConfigMap := factory.FromMap(
2929
map[string]interface{}{
3030
"apiVersion": "v1",

internal/k8sdeps/patch/patch_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import (
2929
)
3030

3131
var rf = resource.NewFactory(
32-
k8sdeps.NewKustKunstructuredFactory(k8sdeps.NewKustDecoder()))
32+
k8sdeps.NewKunstructuredFactoryImpl(k8sdeps.NewKustDecoder()))
3333
var deploy = gvk.Gvk{Group: "apps", Version: "v1", Kind: "Deployment"}
3434
var foo = gvk.Gvk{Group: "example.com", Version: "v1", Kind: "Foo"}
3535

internal/k8sdeps/unstructadapter_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
)
2222

2323
func TestGetFieldValue(t *testing.T) {
24-
factory := NewKustKunstructuredFactory(NewKustDecoder())
24+
factory := NewKunstructuredFactoryImpl(NewKustDecoder())
2525
kunstructured := factory.FromMap(map[string]interface{}{
2626
"Kind": "Service",
2727
"metadata": map[string]interface{}{

kustomize.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func main() {
2929
defer glog.Flush()
3030

3131
if err := commands.NewDefaultCommand(
32-
k8sdeps.NewKustKunstructuredFactory(k8sdeps.NewKustDecoder()),
32+
k8sdeps.NewKunstructuredFactoryImpl(k8sdeps.NewKustDecoder()),
3333
patch.NewPatchTransformerFactory(),
3434
k8sdeps.NewKustDecoder(),
3535
k8sdeps.NewKustValidator(),

pkg/commands/build/build.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Use different transformer configurations by passing files to kustomize
6464
func NewCmdBuild(
6565
out io.Writer, fs fs.FileSystem,
6666
kf ifc.KunstructuredFactory,
67-
ptf patch.PatchTransformerFactory,
67+
ptf patch.TransformerFactory,
6868
decoder ifc.Decoder, hash ifc.Hash) *cobra.Command {
6969
var o buildOptions
7070
var p string
@@ -125,7 +125,7 @@ func (o *buildOptions) Validate(args []string, p string, fs fs.FileSystem) error
125125
func (o *buildOptions) RunBuild(
126126
out io.Writer, fSys fs.FileSystem,
127127
kf ifc.KunstructuredFactory,
128-
ptf patch.PatchTransformerFactory,
128+
ptf patch.TransformerFactory,
129129
decoder ifc.Decoder, hash ifc.Hash) error {
130130
rootLoader, err := loader.NewLoader(o.kustomizationPath, "", fSys)
131131
if err != nil {

pkg/commands/build/build_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ func runBuildTestCase(t *testing.T, testcaseName string, updateKustomizeExpected
131131
buf := bytes.NewBuffer([]byte{})
132132
err = ops.RunBuild(
133133
buf, fSys,
134-
k8sdeps.NewKustKunstructuredFactory(k8sdeps.NewKustDecoder()),
134+
k8sdeps.NewKunstructuredFactoryImpl(k8sdeps.NewKustDecoder()),
135135
patch.NewPatchTransformerFactory(),
136136
k8sdeps.NewKustDecoder(), k8sdeps.NewKustHash())
137137
switch {

pkg/commands/commands.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import (
3232

3333
// NewDefaultCommand returns the default (aka root) command for kustomize command.
3434
func NewDefaultCommand(
35-
kf ifc.KunstructuredFactory, ptf patch.PatchTransformerFactory,
35+
kf ifc.KunstructuredFactory, ptf patch.TransformerFactory,
3636
decoder ifc.Decoder,
3737
validator ifc.Validator, hash ifc.Hash) *cobra.Command {
3838
fsys := fs.MakeRealFS()

pkg/crds/crds_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,22 +152,22 @@ func makeLoader(t *testing.T) ifc.Loader {
152152
func TestRegisterCRD(t *testing.T) {
153153
refpathconfigs := []transformerconfig.ReferencePathConfig{
154154
{
155-
Gvk: gvk.Gvk{Kind: "Bee", Version: "v1beta1"},
155+
Gvk: gvk.Gvk{Kind: "Secret", Version: "v1"},
156156
PathConfigs: []transformerconfig.PathConfig{
157157
{
158158
CreateIfNotPresent: false,
159159
Gvk: gvk.Gvk{Kind: "MyKind"},
160-
Path: "spec/beeRef/name",
160+
Path: "spec/secretRef/name",
161161
},
162162
},
163163
},
164164
{
165-
Gvk: gvk.Gvk{Kind: "Secret", Version: "v1"},
165+
Gvk: gvk.Gvk{Kind: "Bee", Version: "v1beta1"},
166166
PathConfigs: []transformerconfig.PathConfig{
167167
{
168168
CreateIfNotPresent: false,
169169
Gvk: gvk.Gvk{Kind: "MyKind"},
170-
Path: "spec/secretRef/name",
170+
Path: "spec/beeRef/name",
171171
},
172172
},
173173
},

pkg/ifc/patch/patch.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"sigs.k8s.io/kustomize/pkg/transformers"
2323
)
2424

25-
// PatchTransformerFactory makes patch transformer.
26-
type PatchTransformerFactory interface {
25+
// TransformerFactory makes patch transformer.
26+
type TransformerFactory interface {
2727
MakePatchTransformer(slice []*resource.Resource, rf *resource.Factory) (transformers.Transformer, error)
2828
}

0 commit comments

Comments
 (0)