Skip to content

Commit 6497e09

Browse files
authored
Bump krm-functions-sdk, kpt API and kpt in porch (#1115)
* Bump kpt API in porch API Signed-off-by: liamfallon <liam.fallon@est.tech> * Update root go.mod Signed-off-by: liamfallon <liam.fallon@est.tech> * Updates to Porch for the new kpt api Signed-off-by: liamfallon <liam.fallon@est.tech> * Add support for push-on-fail annotation on subpackages Signed-off-by: liamfallon <liam.fallon@est.tech> * Retract old Nephio porch/api v1.3.0 release Signed-off-by: liamfallon <liam.fallon@est.tech> * Revert subpackage changes Signed-off-by: liamfallon <liam.fallon@est.tech> * Revert subpackage changes Signed-off-by: liamfallon <liam.fallon@est.tech> * Revert subpackage changes Signed-off-by: liamfallon <liam.fallon@est.tech> --------- Signed-off-by: liamfallon <liam.fallon@est.tech>
1 parent 6b945b5 commit 6497e09

13 files changed

Lines changed: 87 additions & 105 deletions

File tree

api/go.mod

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ module github.com/kptdev/porch/api
22

33
go 1.26.0
44

5+
retract v1.3.0
6+
57
require (
6-
github.com/kptdev/kpt/api v0.0.1
8+
github.com/kptdev/kpt/api v0.0.2
79
github.com/pkg/errors v0.9.1
810
github.com/stretchr/testify v1.11.1
911
k8s.io/api v0.36.1

api/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8Hm
3434
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
3535
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
3636
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
37-
github.com/kptdev/kpt/api v0.0.1 h1:1PZ/lA0IuMYkgrSXCJqk3fcVok8tyuP6gOmHhrTETdM=
38-
github.com/kptdev/kpt/api v0.0.1/go.mod h1:JviL89EPiMTdxSSJL9sXnOuckflKVXZKKDCu9YJ5kM4=
37+
github.com/kptdev/kpt/api v0.0.2 h1:0AWWhw8/LapkPwDwImtJXUDx81U9nW+joYIzCl3S/68=
38+
github.com/kptdev/kpt/api v0.0.2/go.mod h1:D/WM1LJ/HvHt3cHxDs2mF6mXkA37BbD1nrcsAVWgbfE=
3939
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
4040
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
4141
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=

func/internal/podcachemanager.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,6 @@ func (pcm *podCacheManager) podCacheManager(ctx context.Context) {
120120
for {
121121
select {
122122
case req := <-pcm.connectionRequestCh:
123-
if pcm.podManager.imageResolver != nil {
124-
req.image = pcm.podManager.imageResolver(req.image)
125-
}
126123
fn := pcm.FunctionInfo(req.image)
127124

128125
shouldScaleUp := false
@@ -378,7 +375,6 @@ func (pcm *podCacheManager) warmupCache(defaultImagePrefix string) error {
378375
} else {
379376
image = ImageJoin(defaultImagePrefix, image)
380377
}
381-
image = pcm.podManager.imageResolver(image)
382378
fn := pcm.FunctionInfo(image)
383379
if len(fn.pods) == 0 {
384380
fn.pods = append(fn.pods, NewPodInfo(nil))

func/internal/podevaluator.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121
"time"
2222

2323
"github.com/kptdev/kpt/pkg/fn/runtime"
24-
"github.com/kptdev/kpt/pkg/lib/runneroptions"
2524
fnconf "github.com/kptdev/porch/controllers/functionconfigs/reconciler"
2625
"github.com/kptdev/porch/func/evaluator"
2726
"github.com/kptdev/porch/pkg/util"
@@ -165,7 +164,6 @@ func NewPodEvaluator(ctx context.Context, o PodEvaluatorOptions, cl client.Clien
165164
registryAuthSecretName: o.RegistryAuthSecretName,
166165
enablePrivateRegistriesTls: o.EnablePrivateRegistriesTls,
167166
tlsSecretPath: o.TlsSecretPath,
168-
imageResolver: runneroptions.ResolveToImageForCLIFunc(o.DefaultImagePrefix),
169167
tagResolver: runtime.TagResolver{},
170168
},
171169
},

func/internal/podmanager.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ import (
3434
containerregistry "github.com/google/go-containerregistry/pkg/v1"
3535
"github.com/google/go-containerregistry/pkg/v1/remote"
3636
"github.com/kptdev/kpt/pkg/fn/runtime"
37-
"github.com/kptdev/kpt/pkg/lib/runneroptions"
3837
configapi "github.com/kptdev/porch/api/porchconfig/v1alpha1"
3938
"go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
4039
"google.golang.org/grpc"
@@ -216,8 +215,6 @@ type podManager struct {
216215
enablePrivateRegistriesTls bool
217216
// The path of the secret used in tls configuration
218217
tlsSecretPath string
219-
// Image resolver that prepends a prefix if necessary
220-
imageResolver runneroptions.ImageResolveFunc
221218
// tagResolver is used to resolve the tag of the given image
222219
tagResolver runtime.TagResolver
223220
// skipGrpcReadyCheck disables the gRPC readiness verification during pod creation (for testing)
@@ -550,9 +547,6 @@ func createTransport(tlsConfig *tls.Config) *http.Transport {
550547
func (pm *podManager) CreatePod(ctx context.Context, image string, postFix int, config *configapi.PodExecutorConfig, useGenerateName bool) (*corev1.Pod, error) {
551548
var de *digestAndEntrypoint
552549
var err error
553-
if pm.imageResolver != nil {
554-
image = pm.imageResolver(image)
555-
}
556550
de, err = pm.imageDigestAndEntrypoint(ctx, image)
557551
if err != nil {
558552
return nil, fmt.Errorf("unable to get the entrypoint for %v: %w", image, err)

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ require (
2020
github.com/google/uuid v1.6.0
2121
github.com/jackc/pgx/v5 v5.10.0
2222
github.com/joho/godotenv v1.5.1
23-
github.com/kptdev/kpt v1.0.0-beta.65
24-
github.com/kptdev/kpt/api v0.0.1
23+
github.com/kptdev/kpt v1.0.0-beta.67
24+
github.com/kptdev/kpt/api v0.0.2
2525
github.com/kptdev/krm-functions-catalog/functions/go/apply-replacements v0.1.5
2626
github.com/kptdev/krm-functions-catalog/functions/go/apply-setters v0.2.4
2727
github.com/kptdev/krm-functions-catalog/functions/go/set-namespace v0.4.5
2828
github.com/kptdev/krm-functions-catalog/functions/go/starlark v0.5.5
29-
github.com/kptdev/krm-functions-sdk/go/fn v1.0.4
29+
github.com/kptdev/krm-functions-sdk/go/fn v1.1.1
3030
github.com/kptdev/porch/api v1.0.1
3131
github.com/onsi/ginkgo/v2 v2.29.0
3232
github.com/onsi/gomega v1.41.0

go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -264,10 +264,10 @@ github.com/klauspost/compress v1.18.6 h1:2jupLlAwFm95+YDR+NwD2MEfFO9d4z4Prjl1XXD
264264
github.com/klauspost/compress v1.18.6/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ=
265265
github.com/klauspost/cpuid/v2 v2.3.0 h1:S4CRMLnYUhGeDFDqkGriYKdfoFlDnMtqTiI/sFzhA9Y=
266266
github.com/klauspost/cpuid/v2 v2.3.0/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=
267-
github.com/kptdev/kpt v1.0.0-beta.65 h1:Xkh1MdE02gepH3XxlrywiNtqdjq3N7rvhAxeA/U7E+o=
268-
github.com/kptdev/kpt v1.0.0-beta.65/go.mod h1:aHpEOCxSPuRSOl6CuGq9D1A+2BxaUZ0xTWJDE/osp5s=
269-
github.com/kptdev/kpt/api v0.0.1 h1:1PZ/lA0IuMYkgrSXCJqk3fcVok8tyuP6gOmHhrTETdM=
270-
github.com/kptdev/kpt/api v0.0.1/go.mod h1:JviL89EPiMTdxSSJL9sXnOuckflKVXZKKDCu9YJ5kM4=
267+
github.com/kptdev/kpt v1.0.0-beta.67 h1:O9GWlIgk/+4N/9JHONf1F71w3gwNN6TptQWrPEoRWWQ=
268+
github.com/kptdev/kpt v1.0.0-beta.67/go.mod h1:g/QnlsL6BVdOKb98RkgnQJLLxv7f1liWYrXTUgJpeLo=
269+
github.com/kptdev/kpt/api v0.0.2 h1:0AWWhw8/LapkPwDwImtJXUDx81U9nW+joYIzCl3S/68=
270+
github.com/kptdev/kpt/api v0.0.2/go.mod h1:D/WM1LJ/HvHt3cHxDs2mF6mXkA37BbD1nrcsAVWgbfE=
271271
github.com/kptdev/krm-functions-catalog/functions/go/apply-replacements v0.1.5 h1:IBYx+h8mYZ2mqfLetP6Kwzw3DwvVswk8E6Vu8BuNcyM=
272272
github.com/kptdev/krm-functions-catalog/functions/go/apply-replacements v0.1.5/go.mod h1:Wxd9xCmftcHf8b8Q3dvskY1psJ5knxBAxMZWUHD4L/I=
273273
github.com/kptdev/krm-functions-catalog/functions/go/apply-setters v0.2.4 h1:qB0Az/M+qo31s5RD3YXV0bUkTKZ3I19Kdji42cFSPHY=
@@ -276,8 +276,8 @@ github.com/kptdev/krm-functions-catalog/functions/go/set-namespace v0.4.5 h1:VG7
276276
github.com/kptdev/krm-functions-catalog/functions/go/set-namespace v0.4.5/go.mod h1:S9jfWV9f9cs4gAH70ND8c6snLBDAT9TMxoMQvJJhM04=
277277
github.com/kptdev/krm-functions-catalog/functions/go/starlark v0.5.5 h1:2fVPRn0knqm4XoXfYN7mWt99MOevHhR8eoKvqnmhzY4=
278278
github.com/kptdev/krm-functions-catalog/functions/go/starlark v0.5.5/go.mod h1:PE/l25mFdKm9MibK2sh/vO1YdFvrMIc3MXwyJW/scB0=
279-
github.com/kptdev/krm-functions-sdk/go/fn v1.0.4 h1:2Cl68JgaNva8eZ/YzqiZNOXkjIhavqLsoGOnxYN13Oc=
280-
github.com/kptdev/krm-functions-sdk/go/fn v1.0.4/go.mod h1:NqMHvghKasESpZImCDIOp5r10g3vmOeCcHzvjyL+4vk=
279+
github.com/kptdev/krm-functions-sdk/go/fn v1.1.1 h1:F/tdu0FSWSnLaAV+AC8CVS0YGpUwkVnAs+O5NHPRmQU=
280+
github.com/kptdev/krm-functions-sdk/go/fn v1.1.1/go.mod h1:rPrLdh02mfqq5PjZRrMr5mhRA6dkjKm7O4bm5VZJWOg=
281281
github.com/kptdev/porch/api v1.0.1 h1:juMFLFN7RNeSzGSTyve/aHYODk4t7AGWfCXnvmzVG0o=
282282
github.com/kptdev/porch/api v1.0.1/go.mod h1:ixE34HC9j3OmA2F5v215l97X//izul0qbg5ci/F5xSo=
283283
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=

pkg/cli/commands/rpkg/upgrade/command.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import (
2424

2525
kptfilev1 "github.com/kptdev/kpt/api/kptfile/v1"
2626
"github.com/kptdev/kpt/pkg/lib/errors"
27-
"github.com/kptdev/krm-functions-sdk/go/fn/kptfileapi"
2827
"github.com/kptdev/krm-functions-sdk/go/fn/kptfileko"
2928
porchapi "github.com/kptdev/porch/api/porch"
3029
porchapiv1alpha1 "github.com/kptdev/porch/api/porch/v1alpha1"
@@ -496,7 +495,7 @@ func (r *runner) findLatestPackageRevisionForRef(name, repo string) *porchapiv1a
496495
return output
497496
}
498497

499-
func (r *runner) findPackageRevisionFromUpstream(upstream *kptfileapi.Upstream) (*porchapiv1alpha1.PackageRevision, error) {
498+
func (r *runner) findPackageRevisionFromUpstream(upstream *kptfilev1.Upstream) (*porchapiv1alpha1.PackageRevision, error) {
500499
upstreamRepo, upstreamPkg, upstreamRef, isManaged, err := util.GetRepoPackageRefFromUpstream(upstream)
501500

502501
if err != nil {

pkg/cli/commands/rpkg/upgrade/command_test.go

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -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",

pkg/task/generictaskhandler_test.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,6 @@ func TestDoPrMutations(t *testing.T) {
160160
ror := func(namespace string) runneroptions.RunnerOptions {
161161
return runneroptions.RunnerOptions{
162162
ImagePullPolicy: runneroptions.IfNotPresentPull,
163-
ResolveToImage: func(image string) string {
164-
return image
165-
},
166163
}
167164
}
168165

@@ -577,9 +574,6 @@ func TestDoPrResourceMutations(t *testing.T) {
577574
ror := func(namespace string) runneroptions.RunnerOptions {
578575
return runneroptions.RunnerOptions{
579576
ImagePullPolicy: runneroptions.IfNotPresentPull,
580-
ResolveToImage: func(image string) string {
581-
return image
582-
},
583577
}
584578
}
585579

0 commit comments

Comments
 (0)