Skip to content

Commit ce2a3f4

Browse files
authored
fix: use KptFileKind variable instead of KptFileName for GVR (#2580)
When specifying the Kptfile resource kind, some code were using the KptFileName variable instead of KptFileKind. Both variables currently contain the same value: "Kptfile", but this will be an issue in the future should the KptFileName and KptFileKind variables have different values.
1 parent d61fd35 commit ce2a3f4

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

internal/cmdget/cmdget_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func TestCmd_execute(t *testing.T) {
6868
},
6969
TypeMeta: yaml.TypeMeta{
7070
APIVersion: kptfilev1.KptFileAPIVersion,
71-
Kind: kptfilev1.KptFileName},
71+
Kind: kptfilev1.KptFileKind},
7272
},
7373
Upstream: &kptfilev1.Upstream{
7474
Type: kptfilev1.GitOrigin,
@@ -128,7 +128,7 @@ func TestCmdMainBranch_execute(t *testing.T) {
128128
},
129129
TypeMeta: yaml.TypeMeta{
130130
APIVersion: kptfilev1.KptFileAPIVersion,
131-
Kind: kptfilev1.KptFileName},
131+
Kind: kptfilev1.KptFileKind},
132132
},
133133
Upstream: &kptfilev1.Upstream{
134134
Type: kptfilev1.GitOrigin,

internal/util/fetch/fetch_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ func TestCommand_Run(t *testing.T) {
196196
},
197197
TypeMeta: yaml.TypeMeta{
198198
APIVersion: kptfilev1.KptFileAPIVersion,
199-
Kind: kptfilev1.KptFileName},
199+
Kind: kptfilev1.KptFileKind},
200200
},
201201
Upstream: &kptfilev1.Upstream{
202202
Type: "git",
@@ -258,7 +258,7 @@ func TestCommand_Run_subdir(t *testing.T) {
258258
},
259259
TypeMeta: yaml.TypeMeta{
260260
APIVersion: kptfilev1.KptFileAPIVersion,
261-
Kind: kptfilev1.KptFileName},
261+
Kind: kptfilev1.KptFileKind},
262262
},
263263
Upstream: &kptfilev1.Upstream{
264264
Type: kptfilev1.GitOrigin,
@@ -334,7 +334,7 @@ func TestCommand_Run_branch(t *testing.T) {
334334
},
335335
TypeMeta: yaml.TypeMeta{
336336
APIVersion: kptfilev1.KptFileAPIVersion,
337-
Kind: kptfilev1.KptFileName},
337+
Kind: kptfilev1.KptFileKind},
338338
},
339339
Upstream: &kptfilev1.Upstream{
340340
Type: kptfilev1.GitOrigin,
@@ -415,7 +415,7 @@ func TestCommand_Run_tag(t *testing.T) {
415415
},
416416
TypeMeta: yaml.TypeMeta{
417417
APIVersion: kptfilev1.KptFileAPIVersion,
418-
Kind: kptfilev1.KptFileName},
418+
Kind: kptfilev1.KptFileKind},
419419
},
420420
Upstream: &kptfilev1.Upstream{
421421
Type: "git",

pkg/api/kptfile/v1/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const (
3535
var TypeMeta = yaml.ResourceMeta{
3636
TypeMeta: yaml.TypeMeta{
3737
APIVersion: KptFileAPIVersion,
38-
Kind: KptFileName,
38+
Kind: KptFileKind,
3939
},
4040
}
4141

pkg/live/load.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ type InventoryFilter struct {
175175

176176
func (i *InventoryFilter) Filter(object *yaml.RNode) (*yaml.RNode, error) {
177177
if object.GetApiVersion() != kptfilev1.KptFileAPIVersion ||
178-
object.GetKind() != kptfilev1.KptFileName {
178+
object.GetKind() != kptfilev1.KptFileKind {
179179
return object, nil
180180
}
181181

0 commit comments

Comments
 (0)