@@ -24,7 +24,7 @@ import (
2424 "testing"
2525
2626 "github.com/google/go-cmp/cmp"
27- "github.com/kptdev/krm-functions-sdk/go/fn/kptfileapi "
27+ kptfilev1 "github.com/kptdev/kpt/api/kptfile/v1 "
2828 porchapi "github.com/kptdev/porch/api/porch/v1alpha1"
2929 configapi "github.com/kptdev/porch/api/porchconfig/v1alpha1"
3030 "github.com/kptdev/porch/pkg/repository"
@@ -1267,7 +1267,7 @@ func TestFindPackageRevisionFromUpstreamRootDirectory(t *testing.T) {
12671267
12681268 tests := []struct {
12691269 name string
1270- upstream * kptfileapi .Upstream
1270+ upstream * kptfilev1 .Upstream
12711271 expectErr bool
12721272 errContains string
12731273 }{
@@ -1279,17 +1279,17 @@ func TestFindPackageRevisionFromUpstreamRootDirectory(t *testing.T) {
12791279 },
12801280 {
12811281 name : "error when upstream git is nil" ,
1282- upstream : & kptfileapi .Upstream {
1282+ upstream : & kptfilev1 .Upstream {
12831283 Git : nil ,
12841284 },
12851285 expectErr : true ,
12861286 errContains : "could not find upstream references" ,
12871287 },
12881288 {
12891289 name : "error when directory has leading slash" ,
1290- upstream : & kptfileapi .Upstream {
1291- Type : kptfileapi .GitOrigin ,
1292- Git : & kptfileapi .Git {
1290+ upstream : & kptfilev1 .Upstream {
1291+ Type : kptfilev1 .GitOrigin ,
1292+ Git : & kptfilev1 .Git {
12931293 Repo : "https://github.com/user/repo.git" ,
12941294 Directory : "/mypkg" ,
12951295 Ref : "mypkg/v1" ,
@@ -1300,9 +1300,9 @@ func TestFindPackageRevisionFromUpstreamRootDirectory(t *testing.T) {
13001300 },
13011301 {
13021302 name : "error when ref is not managed (does not match directory/version pattern)" ,
1303- upstream : & kptfileapi .Upstream {
1304- Type : kptfileapi .GitOrigin ,
1305- Git : & kptfileapi .Git {
1303+ upstream : & kptfilev1 .Upstream {
1304+ Type : kptfilev1 .GitOrigin ,
1305+ Git : & kptfilev1 .Git {
13061306 Repo : "https://github.com/user/repo.git" ,
13071307 Directory : "mypkg" ,
13081308 Ref : "main" ,
@@ -1313,9 +1313,9 @@ func TestFindPackageRevisionFromUpstreamRootDirectory(t *testing.T) {
13131313 },
13141314 {
13151315 name : "error when ref is empty" ,
1316- upstream : & kptfileapi .Upstream {
1317- Type : kptfileapi .GitOrigin ,
1318- Git : & kptfileapi .Git {
1316+ upstream : & kptfilev1 .Upstream {
1317+ Type : kptfilev1 .GitOrigin ,
1318+ Git : & kptfilev1 .Git {
13191319 Repo : "https://github.com/user/repo.git" ,
13201320 Directory : "mypkg" ,
13211321 Ref : "" ,
@@ -1326,9 +1326,9 @@ func TestFindPackageRevisionFromUpstreamRootDirectory(t *testing.T) {
13261326 },
13271327 {
13281328 name : "error when directory is empty" ,
1329- upstream : & kptfileapi .Upstream {
1330- Type : kptfileapi .GitOrigin ,
1331- Git : & kptfileapi .Git {
1329+ upstream : & kptfilev1 .Upstream {
1330+ Type : kptfilev1 .GitOrigin ,
1331+ Git : & kptfilev1 .Git {
13321332 Repo : "https://github.com/user/repo.git" ,
13331333 Directory : "" ,
13341334 Ref : "mypkg/v1" ,
@@ -1339,9 +1339,9 @@ func TestFindPackageRevisionFromUpstreamRootDirectory(t *testing.T) {
13391339 },
13401340 {
13411341 name : "managed ref with matching repo finds package revision" ,
1342- upstream : & kptfileapi .Upstream {
1343- Type : kptfileapi .GitOrigin ,
1344- Git : & kptfileapi .Git {
1342+ upstream : & kptfilev1 .Upstream {
1343+ Type : kptfilev1 .GitOrigin ,
1344+ Git : & kptfilev1 .Git {
13451345 Repo : "https://github.com/user/repo.git" ,
13461346 Directory : "mypkg" ,
13471347 Ref : "mypkg/v1" ,
@@ -1445,9 +1445,9 @@ func TestFindPackageRevisionFromUpstreamBestMatch(t *testing.T) {
14451445 r := createRunner (ctx , c , prs , ns , 0 )
14461446
14471447 // Use a managed ref pattern (directory/version)
1448- kptfileUpstream := & kptfileapi .Upstream {
1449- Type : kptfileapi .GitOrigin ,
1450- Git : & kptfileapi .Git {
1448+ kptfileUpstream := & kptfilev1 .Upstream {
1449+ Type : kptfilev1 .GitOrigin ,
1450+ Git : & kptfilev1 .Git {
14511451 Repo : "https://github.com/user/repo.git" ,
14521452 Directory : "mypkg" ,
14531453 Ref : "mypkg/v1" ,
0 commit comments