From 4a7785262f5e213ae019e390e1083fafb08a6547 Mon Sep 17 00:00:00 2001 From: Istvan Kispal Date: Thu, 15 Aug 2024 18:55:53 +0200 Subject: [PATCH] Add proper test to PAckageVariant inject package functionality --- .dockerignore | 1 + .vscode/launch.json | 4 +- controllers/go.mod | 1 + controllers/go.sum | 3 +- .../controllers/packagevariant/mutations.go | 4 +- .../packagevariant_controller.go | 9 +- go.mod | 18 ++- go.sum | 64 +++----- test/e2e/e2e_test.go | 146 ++++++++++++++++-- test/e2e/e2e_utils_test.go | 94 ++++++++++- test/e2e/suite.go | 2 + 11 files changed, 269 insertions(+), 77 deletions(-) diff --git a/.dockerignore b/.dockerignore index 12b36705..74561975 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,3 +2,4 @@ .cache/ default.etcd/ apiserver.local.config/ +__debug_bin* diff --git a/.vscode/launch.json b/.vscode/launch.json index af69815a..c97687f6 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -28,7 +28,7 @@ "type": "go", "request": "launch", "mode": "auto", - "program": "${workspaceFolder}/controllers", + "program": "${workspaceFolder}/controllers/main.go", "cwd": "${workspaceFolder}", "env": { "ENABLE_PACKAGEVARIANTS": "true", @@ -44,7 +44,7 @@ "args": [ "-test.v", "-test.run", - "TestE2E/PorchSuite/TestGitRepositoryWithReleaseTagsAndDirectory" + "TestE2E/PorchSuite/TestPackageVariantMutationInjectPackage" ], "env": { "E2E": "1"} }, diff --git a/controllers/go.mod b/controllers/go.mod index 31bdad16..8e46d239 100644 --- a/controllers/go.mod +++ b/controllers/go.mod @@ -79,6 +79,7 @@ require ( github.com/prometheus/client_model v0.5.0 // indirect github.com/prometheus/common v0.45.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect + github.com/rogpeppe/go-internal v1.11.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/spf13/cobra v1.7.0 // indirect github.com/spf13/pflag v1.0.5 // indirect diff --git a/controllers/go.sum b/controllers/go.sum index fb8cea10..7b59ae2a 100644 --- a/controllers/go.sum +++ b/controllers/go.sum @@ -184,8 +184,7 @@ github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lne github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY= github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8= diff --git a/controllers/packagevariants/pkg/controllers/packagevariant/mutations.go b/controllers/packagevariants/pkg/controllers/packagevariant/mutations.go index 17e517f6..67da0486 100644 --- a/controllers/packagevariants/pkg/controllers/packagevariant/mutations.go +++ b/controllers/packagevariants/pkg/controllers/packagevariant/mutations.go @@ -93,7 +93,7 @@ func (i *injectPackage) Apply(ctx context.Context, prr *porchapi.PackageRevision // Load the PackageRevisionResources var prrToInject porchapi.PackageRevisionResources if err := i.client.Get(ctx, client.ObjectKeyFromObject(prToInject), &prrToInject); err != nil { - return err + return fmt.Errorf("couldn't read the package revision that should be inserted (%s/%s/%s): %w", i.config.Package.Repo, i.config.Package.Package, i.config.Package.Revision, err) } // Inject the resources @@ -101,5 +101,7 @@ func (i *injectPackage) Apply(ctx context.Context, prr *porchapi.PackageRevision newResources[i.config.Subdir+"/"+filename] = content } + prr.Spec.Resources = newResources + return nil } diff --git a/controllers/packagevariants/pkg/controllers/packagevariant/packagevariant_controller.go b/controllers/packagevariants/pkg/controllers/packagevariant/packagevariant_controller.go index 077092ba..d3fb75d3 100644 --- a/controllers/packagevariants/pkg/controllers/packagevariant/packagevariant_controller.go +++ b/controllers/packagevariants/pkg/controllers/packagevariant/packagevariant_controller.go @@ -81,10 +81,14 @@ func (r *PackageVariantReconciler) Reconcile(ctx context.Context, req ctrl.Reque } ctx = WithPackageRevisions(ctx, PackageRevisions(prList.Items)) + skipStatusUpdate := false defer func() { - if err := r.Client.Status().Update(ctx, pv); err != nil { - klog.Errorf("could not update status: %s\n", err.Error()) + if !skipStatusUpdate { + if err := r.Client.Status().Update(ctx, pv); err != nil { + klog.Errorf("could not update status: %s\n", err.Error()) + } } + }() if !pv.ObjectMeta.DeletionTimestamp.IsZero() { @@ -92,6 +96,7 @@ func (r *PackageVariantReconciler) Reconcile(ctx context.Context, req ctrl.Reque // are deleted. Normally, garbage collection can handle this, but we have a special case here because // (a) we cannot delete published packagerevisions and instead have to propose deletion of them // (b) we may want to orphan packagerevisions instead of deleting them. + skipStatusUpdate = true for _, pr := range prList.Items { if r.hasOurOwnerReference(pv, pr.OwnerReferences) { r.deleteOrOrphan(ctx, &pr, pv) diff --git a/go.mod b/go.mod index cdae39dd..227b94b1 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/GoogleContainerTools/kpt-functions-catalog/functions/go/apply-setters v0.2.0 github.com/GoogleContainerTools/kpt-functions-catalog/functions/go/set-namespace v0.4.1 github.com/GoogleContainerTools/kpt-functions-catalog/functions/go/starlark v0.4.3 - github.com/GoogleContainerTools/kpt-functions-sdk/go/fn v0.0.0-20220506190241-f85503febd54 + github.com/GoogleContainerTools/kpt-functions-sdk/go/fn v0.0.0-20230427202446-3255accc518d github.com/bluekeyes/go-gitdiff v0.6.1 github.com/bytecodealliance/wasmtime-go v0.39.0 github.com/cpuguy83/go-md2man/v2 v2.0.2 @@ -24,6 +24,7 @@ require ( github.com/google/uuid v1.6.0 github.com/hexops/gotextdiff v1.0.3 github.com/nephio-project/porch/api v0.0.0-20240722132258-c4b36b7a5fb1 + github.com/nephio-project/porch/controllers v0.0.0-20240813115737-12b79b20e318 github.com/otiai10/copy v1.7.0 github.com/philopon/go-toposort v0.0.0-20170620085441-9be86dbd762f github.com/prep/wasmexec v0.0.0-20220807105708-6554945c1dec @@ -39,7 +40,7 @@ require ( golang.org/x/mod v0.16.0 golang.org/x/oauth2 v0.18.0 golang.org/x/tools v0.19.0 - google.golang.org/api v0.126.0 + google.golang.org/api v0.142.0 google.golang.org/genproto v0.0.0-20230822172742-b8732ec3820d google.golang.org/grpc v1.59.0 google.golang.org/protobuf v1.33.0 @@ -55,7 +56,7 @@ require ( k8s.io/klog/v2 v2.120.1 k8s.io/kube-aggregator v0.29.2 k8s.io/kubectl v0.29.2 - k8s.io/utils v0.0.0-20230726121419-3b25d923346b + k8s.io/utils v0.0.0-20240310230437-4693a0247e57 sigs.k8s.io/cli-utils v0.35.0 sigs.k8s.io/controller-runtime v0.17.2 sigs.k8s.io/kustomize/api v0.13.5-0.20230601165947-6ce0bf390ce3 @@ -69,6 +70,7 @@ require ( dario.cat/mergo v1.0.0 // indirect github.com/360EntSecGroup-Skylar/excelize v1.4.1 // indirect github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect + github.com/GoogleContainerTools/kpt-functions-sdk/go/api v0.0.0-20220720212527-133180134b93 // indirect github.com/MakeNowJust/heredoc v1.0.0 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect github.com/NYTimes/gziphandler v1.1.1 // indirect @@ -112,9 +114,9 @@ require ( github.com/google/cel-go v0.17.7 // indirect github.com/google/gnostic-models v0.6.8 // indirect github.com/google/gofuzz v1.2.0 // indirect - github.com/google/s2a-go v0.1.4 // indirect - github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect - github.com/googleapis/gax-go/v2 v2.11.0 // indirect + github.com/google/s2a-go v0.1.7 // indirect + github.com/googleapis/enterprise-certificate-proxy v0.2.5 // indirect + github.com/googleapis/gax-go/v2 v2.12.0 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect @@ -171,7 +173,7 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/crypto v0.21.0 // indirect - golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect + golang.org/x/exp v0.0.0-20220916125017-b168a2c6b86b // indirect golang.org/x/net v0.22.0 // indirect golang.org/x/sync v0.6.0 // indirect golang.org/x/sys v0.18.0 // indirect @@ -181,7 +183,7 @@ require ( gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20230913181813-007df8e322eb // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect diff --git a/go.sum b/go.sum index 10a8182f..e35bb709 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,4 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go/compute v1.23.0 h1:tP41Zoavr8ptEqaW6j+LQOnyBBhO7OkOMAGrgLopTwY= cloud.google.com/go/compute v1.23.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= @@ -23,8 +22,10 @@ github.com/GoogleContainerTools/kpt-functions-catalog/functions/go/set-namespace github.com/GoogleContainerTools/kpt-functions-catalog/functions/go/set-namespace v0.4.1/go.mod h1:5XWywBvOyBmuIoD9waCvtL2jXaZBYAY6QH+s9UunlVY= github.com/GoogleContainerTools/kpt-functions-catalog/functions/go/starlark v0.4.3 h1:fipXlh4qYf5vkpUEA8wmK6YLIC1mgPMsHUpF7gIYamU= github.com/GoogleContainerTools/kpt-functions-catalog/functions/go/starlark v0.4.3/go.mod h1:V11NRqrqOFy43O35azz012xtNBU/px2b8qclZn3Ohpg= -github.com/GoogleContainerTools/kpt-functions-sdk/go/fn v0.0.0-20220506190241-f85503febd54 h1:z5iYiugZJiTzQ6ggU0Cae/T+LkrDwcqZyebh8SbmQ0E= -github.com/GoogleContainerTools/kpt-functions-sdk/go/fn v0.0.0-20220506190241-f85503febd54/go.mod h1:vl3iiwgrqdDgvGi5ckt3O9IoyaHUgFkfxE4RjQIqgwk= +github.com/GoogleContainerTools/kpt-functions-sdk/go/api v0.0.0-20220720212527-133180134b93 h1:c1GhPzYzU2a3E+/2WB9OxoljK2pNYfsBF5Fz9GkdYXs= +github.com/GoogleContainerTools/kpt-functions-sdk/go/api v0.0.0-20220720212527-133180134b93/go.mod h1:gkK43tTaPXFNASpbIbQImzhmt1hdcdin++kvzTblykc= +github.com/GoogleContainerTools/kpt-functions-sdk/go/fn v0.0.0-20230427202446-3255accc518d h1:kgC/R6Kl+tBjsRvcPr4Beae1MiHumNMtbmUTy7qlPZI= +github.com/GoogleContainerTools/kpt-functions-sdk/go/fn v0.0.0-20230427202446-3255accc518d/go.mod h1:Pnd3ImgaWS3OBVjztSiGMACMf+CDs20l5nT5Oljy/tA= github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ= github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE= github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= @@ -46,7 +47,6 @@ github.com/andybalholm/cascadia v1.1.0 h1:BuuO6sSfQNFRu1LppgbD25Hr2vLYW25JvxHs5z github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8= github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df h1:7RFfzj4SSt6nnvCPbCqijJi1nWCd+TqAT3bYCStRC18= github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df/go.mod h1:pSwJ0fSY5KhvocuWSx4fz3BA8OrA1bQn+K1Eli3BRwM= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= @@ -69,7 +69,6 @@ github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqy github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chai2010/gettext-go v1.0.2 h1:1Lwwip6Q2QGsAdl/ZKPCwTe9fe0CjlUbqj5bFNSjIRk= @@ -82,11 +81,6 @@ github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUK github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= -github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4 h1:/inchEIKaYC1Akx+H+gqO04wryn5h75LSazbRlnya1k= github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/containerd/stargz-snapshotter/estargz v0.14.3 h1:OqlDCK3ZVUO6C3B/5FSkDwbkEETK84kQgEeFwDC+62k= @@ -137,8 +131,6 @@ github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FM github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v1.0.2 h1:QkIBuU5k+x7/QXPvPPnWXWlCdaBFApVqftFV6k087DA= github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE= @@ -211,7 +203,6 @@ github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfb github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= @@ -220,8 +211,6 @@ github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvq github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -238,7 +227,6 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= @@ -249,18 +237,18 @@ github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/s2a-go v0.1.4 h1:1kZ/sQM3srePvKs3tXAvQzo66XfcReoqFpIpIccE7Oc= -github.com/google/s2a-go v0.1.4/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= +github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= +github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/enterprise-certificate-proxy v0.2.3 h1:yk9/cqRKtT9wXZSsRH9aurXEpJX+U6FLtpYTdC3R06k= -github.com/googleapis/enterprise-certificate-proxy v0.2.3/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= -github.com/googleapis/gax-go/v2 v2.11.0 h1:9V9PWXEsWnPpQhu/PeQIkS4eGzMlTLGgt80cUUI8Ki4= -github.com/googleapis/gax-go/v2 v2.11.0/go.mod h1:DxmR61SGKkGLa2xigwuZIQpkCI2S5iydzRfb3peWZJI= +github.com/googleapis/enterprise-certificate-proxy v0.2.5 h1:UR4rDjcgpgEnqpIEvkiqTYKBCKLNmlge2eVjoZfySzM= +github.com/googleapis/enterprise-certificate-proxy v0.2.5/go.mod h1:RxW0N9901Cko1VOCW3SXCpWP+mlIEkk2tP7jnHy9a3w= +github.com/googleapis/gax-go/v2 v2.12.0 h1:A+gCJKdRfqXkr+BIRGtZLibNXf0m1f9E4HG56etFpas= +github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU= github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= @@ -354,6 +342,8 @@ github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/nephio-project/porch/api v0.0.0-20240722132258-c4b36b7a5fb1 h1:/eKsBYxcv7VJBGxzezee34JuX5P0dhcxYCumiY5IL04= github.com/nephio-project/porch/api v0.0.0-20240722132258-c4b36b7a5fb1/go.mod h1:qHyDwqL9NeZwbkZkqaZGjJ12OjEId57Fbwhwbf+ufdE= +github.com/nephio-project/porch/controllers v0.0.0-20240813115737-12b79b20e318 h1:9safCGuCiBfcc+UuIhS3YJxaH7EAc7h1/zl0lCtoD4o= +github.com/nephio-project/porch/controllers v0.0.0-20240813115737-12b79b20e318/go.mod h1:v5pwtDMPJEst9KGkS5qW7//0HU71cBJwg+3qH8Tt5PQ= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c h1:Hww8mOyEKTeON4bZn7FrlLismspbPc1teNRUVH7wLQ8= @@ -412,7 +402,6 @@ github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40T github.com/qri-io/starlib v0.5.0 h1:NlveoBAhO6mNgM7+JpM9QlHh3/3pOtOiH6iXaqSdVK0= github.com/qri-io/starlib v0.5.0/go.mod h1:FpVumyB2CMrKIrjf39fAi4uydYWVvnWEvXEOwfzZRHY= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -519,7 +508,6 @@ go.opentelemetry.io/otel/sdk v1.19.0 h1:6USY6zH+L8uMH8L3t1enZPR3WFEmSTADlqldyHtJ go.opentelemetry.io/otel/sdk v1.19.0/go.mod h1:NedEbbS4w3C6zElbLdPJKOpJQOrGUJ+GfzpjUvI0v1A= go.opentelemetry.io/otel/trace v1.19.0 h1:DFVQmlVbfVeOuBRrwdtaehRrWiL1JoVs9CPIQ1Dzxpg= go.opentelemetry.io/otel/trace v1.19.0/go.mod h1:mfaSyvGyEJEI0nyV2I4qhNQnbBOUUmYZpYojqMnX2vo= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I= go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM= go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5/go.mod h1:nmDLcffg48OtT/PSW0Hg7FvpRQsQh5OSqIylirxKC7o= @@ -540,15 +528,14 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e h1:+WEEuIdZHnUeJJmEUjyYC2gfUMj69yZXw17EnHg/otA= -golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e/go.mod h1:Kr81I6Kryrl9sr8s2FK3vxD90NdsKWRuOIl2O4CvYbA= +golang.org/x/exp v0.0.0-20220916125017-b168a2c6b86b h1:SCE/18RnFsLrjydh/R/s5EVvHoZprqEQUuoxK8q2Pc4= +golang.org/x/exp v0.0.0-20220916125017-b168a2c6b86b/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -563,7 +550,6 @@ golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -574,7 +560,6 @@ golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= @@ -586,7 +571,6 @@ golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.18.0 h1:09qnuIAgzdx1XplqJvW6CQqMCtGZykZWcXzPMPUusvI= golang.org/x/oauth2 v0.18.0/go.mod h1:Wf7knwG0MPoWIMMBgFlEaSUDaKskp0dCfrlJRJXbBi8= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -636,7 +620,6 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= @@ -665,31 +648,27 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw= gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= -google.golang.org/api v0.126.0 h1:q4GJq+cAdMAC7XP7njvQ4tvohGLiSlytuL4BQxbIZ+o= -google.golang.org/api v0.126.0/go.mod h1:mBwVAtz+87bEN6CbA1GtZPDOqY2R5ONPqJeIlvyo4Aw= +google.golang.org/api v0.142.0 h1:mf+7EJ94fi5ZcnpPy+m0Yv2dkz8bKm+UL0snTCuwXlY= +google.golang.org/api v0.142.0/go.mod h1:zJAN5o6HRqR7O+9qJUFOWrZkYE66RH+efPBdTLA4xBA= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20230822172742-b8732ec3820d h1:VBu5YqKPv6XiJ199exd8Br+Aetz+o08F+PLMnwJQHAY= google.golang.org/genproto v0.0.0-20230822172742-b8732ec3820d/go.mod h1:yZTlhN0tQnXo3h00fuXNCxJdLdIdnVFVBaRJ5LWBbw4= google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d h1:DoPTO70H+bcDXcd39vOqb2viZxgqeBeSGtZ55yZU4/Q= google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d/go.mod h1:KjSP20unUpOx5kyQUFa7k4OJg0qeJ7DEZflGDu2p6Bk= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d h1:uvYuEyMHKNt+lT4K3bN6fGswmK8qSvcreM3BwjDh+y4= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230913181813-007df8e322eb h1:Isk1sSH7bovx8Rti2wZK0UZF6oraBDK74uoyLEEVFN0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230913181813-007df8e322eb/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -701,8 +680,6 @@ google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= @@ -722,7 +699,6 @@ gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRN gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -766,8 +742,8 @@ k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/A k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= k8s.io/kubectl v0.29.2 h1:uaDYaBhumvkwz0S2XHt36fK0v5IdNgL7HyUniwb2IUo= k8s.io/kubectl v0.29.2/go.mod h1:BhizuYBGcKaHWyq+G7txGw2fXg576QbPrrnQdQDZgqI= -k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= -k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/utils v0.0.0-20240310230437-4693a0247e57 h1:gbqbevonBh57eILzModw6mrkbwM0gQBEuevE/AaBsHY= +k8s.io/utils v0.0.0-20240310230437-4693a0247e57/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.28.0 h1:TgtAeesdhpm2SGwkQasmbeqDo8th5wOBA5h/AjTKA4I= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.28.0/go.mod h1:VHVDI/KrK4fjnV61bE2g3sA7tiETLn8sooImelsCx3Y= sigs.k8s.io/cli-utils v0.35.0 h1:dfSJaF1W0frW74PtjwiyoB4cwdRygbHnC7qe7HF0g/Y= diff --git a/test/e2e/e2e_test.go b/test/e2e/e2e_test.go index 25c6156b..d3ffa2a8 100644 --- a/test/e2e/e2e_test.go +++ b/test/e2e/e2e_test.go @@ -27,6 +27,7 @@ import ( "github.com/google/go-cmp/cmp" porchapi "github.com/nephio-project/porch/api/porch/v1alpha1" configapi "github.com/nephio-project/porch/api/porchconfig/v1alpha1" + pvapi "github.com/nephio-project/porch/controllers/packagevariants/api/v1alpha1" kptfilev1 "github.com/nephio-project/porch/pkg/kpt/api/kptfile/v1" "github.com/nephio-project/porch/pkg/repository" "github.com/stretchr/testify/assert" @@ -220,7 +221,7 @@ func (t *PorchSuite) TestCloneFromUpstream(ctx context.Context) { t.Errorf("istions package upstreamLock.git is missing") } if kptfile.UpstreamLock.Git.Commit == "" { - t.Errorf("isions package upstreamLock.gkti.commit is missing") + t.Errorf("istions package upstreamLock.git.commit is missing") } // Remove commit from comparison @@ -429,7 +430,7 @@ func (t *PorchSuite) TestCloneIntoDeploymentRepository(ctx context.Context) { t.Errorf("istions package upstreamLock.git is missing") } if kptfile.UpstreamLock.Git.Commit == "" { - t.Errorf("isions package upstreamLock.gkti.commit is missing") + t.Errorf("istions package upstreamLock.git.commit is missing") } // Remove commit from comparison @@ -654,7 +655,7 @@ func (t *PorchSuite) TestUpdateResources(ctx context.Context) { golden := filepath.Join("testdata", "update-resources", "want-config-map.yaml") if diff := t.CompareGoldenFileYAML(golden, updated); diff != "" { - t.Errorf("Unexpected updated confg map contents: (-want,+got): %s", diff) + t.Errorf("Unexpected updated config map contents: (-want,+got): %s", diff) } } @@ -998,7 +999,7 @@ func (t *PorchSuite) TestProposeDeleteAndUndo(ctx context.Context) { pkgRev := list.Items[i] t.Run(fmt.Sprintf("revision %s", pkgRev.Spec.Revision), func(newT *testing.T) { // This is a bit awkward, we should find a better way to allow subtests - // with our custom implmentation of t. + // with our custom implementation of t. oldT := t.T t.T = newT defer func() { @@ -1523,7 +1524,7 @@ for resource in ctx.resource_list["items"]: func (t *PorchSuite) TestPodFunctionEvaluatorWithDistrolessImage(ctx context.Context) { if t.local { - t.Skipf("Skipping due to not having pod evalutor in local mode") + t.Skipf("Skipping due to not having pod evaluator in local mode") } t.registerMainGitRepositoryF(ctx, "git-fn-distroless") @@ -1604,7 +1605,7 @@ data: func (t *PorchSuite) TestPodEvaluator(ctx context.Context) { if t.local { - t.Skipf("Skipping due to not having pod evalutor in local mode") + t.Skipf("Skipping due to not having pod evaluator in local mode") } const ( @@ -1765,7 +1766,7 @@ func (t *PorchSuite) TestPodEvaluator(ctx context.Context) { func (t *PorchSuite) TestPodEvaluatorWithFailure(ctx context.Context) { if t.local { - t.Skipf("Skipping due to not having pod evalutor in local mode") + t.Skipf("Skipping due to not having pod evaluator in local mode") } t.registerMainGitRepositoryF(ctx, "git-fn-pod-failure") @@ -1828,7 +1829,7 @@ func (t *PorchSuite) TestRepositoryError(ctx context.Context) { Type: configapi.RepositoryTypeGit, Content: configapi.RepositoryContentPackage, Git: &configapi.GitRepository{ - // Use `incalid` domain: https://www.rfc-editor.org/rfc/rfc6761#section-6.4 + // Use `invalid` domain: https://www.rfc-editor.org/rfc/rfc6761#section-6.4 Repo: "https://repo.invalid/repository.git", }, }, @@ -2387,11 +2388,36 @@ func (t *PorchSuite) TestUniquenessOfUIDs(ctx context.Context) { } } -func (t *PorchSuite) TestPackageRevisionFieldselectors(ctx context.Context) { - t.registerGitRepositoryF(ctx, testBlueprintsRepo, "test-blueprints", "") +func (t *PorchSuite) TestPackageRevisionFieldSelectors(ctx context.Context) { + repo := "test-blueprints" + t.registerGitRepositoryF(ctx, testBlueprintsRepo, repo, "") prList := porchapi.PackageRevisionList{} + pkgName := "basens" + pkgSelector := client.MatchingFields(fields.Set{"spec.packageName": pkgName}) + t.ListE(ctx, &prList, client.InNamespace(t.namespace), pkgSelector) + if len(prList.Items) == 0 { + t.Errorf("Expected at least one PackageRevision with packageName=%q, but got none", pkgName) + } + for _, pr := range prList.Items { + if pr.Spec.PackageName != pkgName { + t.Errorf("PackageRevision %s packageName: want %q, but got %q", pr.Name, pkgName, pr.Spec.PackageName) + } + } + + revName := "v1" + revSelector := client.MatchingFields(fields.Set{"spec.revision": revName}) + t.ListE(ctx, &prList, client.InNamespace(t.namespace), revSelector) + if len(prList.Items) == 0 { + t.Errorf("Expected at least one PackageRevision with revision=%q, but got none", revName) + } + for _, pr := range prList.Items { + if pr.Spec.Revision != revName { + t.Errorf("PackageRevision %s revision: want %q, but got %q", pr.Name, pkgName, pr.Spec.PackageName) + } + } + wsName := "v1" wsSelector := client.MatchingFields(fields.Set{"spec.workspaceName": wsName}) t.ListE(ctx, &prList, client.InNamespace(t.namespace), wsSelector) @@ -2426,4 +2452,104 @@ func (t *PorchSuite) TestPackageRevisionFieldselectors(ctx context.Context) { t.Errorf("PackageRevision %s lifecycle: want %q, but got %q", pr.Name, porchapi.PackageRevisionLifecycleDraft, pr.Spec.Lifecycle) } } + + // test combined selectors + combinedSelector := client.MatchingFields(fields.Set{"spec.revision": revName, "spec.packageName": pkgName}) + t.ListE(ctx, &prList, client.InNamespace(t.namespace), combinedSelector) + if len(prList.Items) == 0 { + t.Errorf("Expected at least one PackageRevision with packageName=%q and revision=%q, but got none", pkgName, revName) + } + for _, pr := range prList.Items { + if pr.Spec.PackageName != pkgName || pr.Spec.Revision != revName { + t.Errorf("PackageRevision %s: want %v/%v, but got %v/%v", pr.Name, pkgName, revName, pr.Spec.PackageName, pr.Spec.Revision) + } + } +} + +func (t *PorchSuite) TestPackageVariantMutationInjectPackage(ctx context.Context) { + const ( + downstreamRepository = "target" + downstreamPackage = "target-package" + upstreamRepository = "test-blueprints" + ) + + t.registerMainGitRepositoryF(ctx, downstreamRepository) + t.registerGitRepositoryF(ctx, testBlueprintsRepo, upstreamRepository, "") + + pv := &pvapi.PackageVariant{ + TypeMeta: metav1.TypeMeta{ + APIVersion: pvapi.GroupVersion.String(), + Kind: "PackageVariant", + }, + ObjectMeta: metav1.ObjectMeta{ + Name: "test-pv", + Namespace: t.namespace, + }, + Spec: pvapi.PackageVariantSpec{ + Upstream: &pvapi.Upstream{ + Repo: upstreamRepository, + Package: "basens", + Revision: "v3", + }, + Downstream: &pvapi.Downstream{ + Repo: downstreamRepository, + Package: downstreamPackage, + }, + Mutations: []pvapi.Mutation{ + { + Type: pvapi.MutationTypeInjectPackage, + InjectPackage: &pvapi.InjectPackage{ + Package: pvapi.Upstream{ + Repo: upstreamRepository, + Package: "basens", + Revision: "v2", + }, + }, + }, + { + Type: pvapi.MutationTypeInjectPackage, + InjectPackage: &pvapi.InjectPackage{ + Package: pvapi.Upstream{ + Repo: upstreamRepository, + Package: "empty", + Revision: "v1", + }, + }, + }, + }, + }, + } + + defer t.DeleteE(ctx, pv) + t.CreateF(ctx, pv) + + // get the contents of the downstream PR + downstreamPR := t.waitUntilDraftPackageRevisionExists(ctx, downstreamRepository, downstreamPackage) + downstreamPRR := t.waitUntilPackageRevisionResourcesExists(ctx, client.ObjectKeyFromObject(downstreamPR)) + + // calculate the expected contents of the downstream PR + expectedContents := t.getContentsOfPackageRevision(ctx, upstreamRepository, "basens", "v3") + injected1 := t.getContentsOfPackageRevision(ctx, upstreamRepository, "basens", "v2") + injected2 := t.getContentsOfPackageRevision(ctx, upstreamRepository, "empty", "v1") + for name, content := range injected1 { + expectedContents["basens/"+name] = content + } + for name, content := range injected2 { + expectedContents["empty/"+name] = content + } + + got, want := downstreamPRR.Spec.Resources, expectedContents + // Only compare the name of the files, not the contents. + // The content of the files are changed by normal PackageVariant behavior. + // NOTE: the comparison below is obviously not efficient, but it is intended to produce a useful error message. + for name := range want { + if _, found := got[name]; !found { + t.Errorf("Resource %s is missing from the downstream package", name) + } + } + for name := range got { + if _, found := want[name]; !found { + t.Errorf("Resource %s is not expected to be in the downstream package", name) + } + } } diff --git a/test/e2e/e2e_utils_test.go b/test/e2e/e2e_utils_test.go index 7481afe4..7335e0bc 100644 --- a/test/e2e/e2e_utils_test.go +++ b/test/e2e/e2e_utils_test.go @@ -28,6 +28,7 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/fields" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/wait" @@ -209,7 +210,6 @@ func (t *TestSuite) registerGitRepositoryFromConfigF(ctx context.Context, name s t.CreateF(ctx, repository) t.Cleanup(func() { - t.Helper() t.DeleteE(ctx, repository) t.waitUntilRepositoryDeleted(ctx, name, t.namespace) t.waitUntilAllPackagesDeleted(ctx, name) @@ -218,6 +218,7 @@ func (t *TestSuite) registerGitRepositoryFromConfigF(ctx context.Context, name s // Make sure the repository is ready before we test to (hopefully) // avoid flakiness. t.waitUntilRepositoryReady(ctx, repository.Name, repository.Namespace) + t.Logf("Repository %s/%s is ready", repository.Namespace, repository.Name) } type repositoryOption func(*configapi.Repository) @@ -307,7 +308,7 @@ func (t *TestSuite) waitUntilRepositoryReady(ctx context.Context, name, namespac Namespace: namespace, } var innerErr error - err := wait.PollUntilContextTimeout(ctx, time.Second, 60*time.Second, true, func(ctx context.Context) (bool, error) { + err := wait.PollUntilContextTimeout(ctx, time.Second, 120*time.Second, true, func(ctx context.Context) (bool, error) { var repo configapi.Repository if err := t.client.Get(ctx, nn, &repo); err != nil { innerErr = err @@ -417,10 +418,14 @@ func (t *TestSuite) waitUntilObjectDeleted(ctx context.Context, gvk schema.Group } } -func (t *TestSuite) waitUntilPackageRevisionExists(ctx context.Context, repository string, pkgName string, revision string) *porchapi.PackageRevision { +func (t *TestSuite) waitUntilPackageRevisionFulfillingConditionExists( + ctx context.Context, + timeout time.Duration, + condition func(porchapi.PackageRevision) bool, +) (*porchapi.PackageRevision, error) { + t.Helper() var foundPkgRev *porchapi.PackageRevision - timeout := 120 * time.Second err := wait.PollUntilContextTimeout(ctx, time.Second, timeout, true, func(ctx context.Context) (done bool, err error) { var pkgRevList porchapi.PackageRevisionList if err := t.client.List(ctx, &pkgRevList); err != nil { @@ -428,18 +433,91 @@ func (t *TestSuite) waitUntilPackageRevisionExists(ctx context.Context, reposito return false, nil } for _, pkgRev := range pkgRevList.Items { - if pkgRev.Spec.RepositoryName == repository && - pkgRev.Spec.PackageName == pkgName && - pkgRev.Spec.Revision == revision { - + if condition(pkgRev) { foundPkgRev = &pkgRev return true, nil } } return false, nil }) + return foundPkgRev, err +} + +func (t *TestSuite) waitUntilPackageRevisionExists(ctx context.Context, repository string, pkgName string, revision string) *porchapi.PackageRevision { + t.Helper() + t.Logf("Waiting for package revision (%v/%v/%v) to exist", repository, pkgName, revision) + timeout := 120 * time.Second + foundPkgRev, err := t.waitUntilPackageRevisionFulfillingConditionExists(ctx, timeout, func(pkgRev porchapi.PackageRevision) bool { + return pkgRev.Spec.RepositoryName == repository && + pkgRev.Spec.PackageName == pkgName && + pkgRev.Spec.Revision == revision + }) if err != nil { t.Fatalf("Package revision (%v/%v/%v) not found in time (%v)", repository, pkgName, revision, timeout) } return foundPkgRev } + +func (t *TestSuite) waitUntilDraftPackageRevisionExists(ctx context.Context, repository string, pkgName string) *porchapi.PackageRevision { + t.Helper() + t.Logf("Waiting for a draft revision for package %v/%v to exist", repository, pkgName) + timeout := 120 * time.Second + foundPkgRev, err := t.waitUntilPackageRevisionFulfillingConditionExists(ctx, timeout, func(pkgRev porchapi.PackageRevision) bool { + return pkgRev.Spec.RepositoryName == repository && + pkgRev.Spec.PackageName == pkgName && + pkgRev.Spec.Lifecycle == porchapi.PackageRevisionLifecycleDraft + }) + if err != nil { + t.Fatalf("No draft package revision found for package %v/%v in time (%v)", repository, pkgName, timeout) + } + return foundPkgRev +} + +func (t *TestSuite) waitUntilPackageRevisionResourcesExists( + ctx context.Context, + key types.NamespacedName, +) *porchapi.PackageRevisionResources { + + t.Helper() + t.Logf("Waiting for PackageRevisionResources object %v to exist", key) + timeout := 120 * time.Second + var foundPrr *porchapi.PackageRevisionResources + err := wait.PollUntilContextTimeout(ctx, time.Second, timeout, true, func(ctx context.Context) (done bool, err error) { + var prrList porchapi.PackageRevisionResourcesList + if err := t.client.List(ctx, &prrList); err != nil { + t.Logf("error listing package revision resources: %v", err) + return false, nil + } + for _, prr := range prrList.Items { + if client.ObjectKeyFromObject(&prr) == key { + foundPrr = &prr + return true, nil + } + } + return false, nil + }) + if err != nil { + t.Fatalf("PackageRevisionResources object wasn't found for package %v in time (%v)", key, timeout) + } + return foundPrr +} + +func (t *TestSuite) getContentsOfPackageRevision(ctx context.Context, repository string, pkgName string, revision string) map[string]string { + + t.Helper() + var prrList porchapi.PackageRevisionResourcesList + selector := client.MatchingFields(fields.Set{ + "spec.repository": repository, + "spec.packageName": pkgName, + "spec.revision": revision, + }) + t.ListF(ctx, &prrList, selector, client.InNamespace(t.namespace)) + + if len(prrList.Items) == 0 { + t.Fatalf("PackageRevisionResources object wasn't found for package revision %v/%v/%v", repository, pkgName, revision) + } + if len(prrList.Items) > 1 { + t.Fatalf("Multiple PackageRevisionResources objects were found for package revision %v/%v/%v", repository, pkgName, revision) + } + return prrList.Items[0].Spec.Resources +} diff --git a/test/e2e/suite.go b/test/e2e/suite.go index 6a37e930..ff956fa8 100644 --- a/test/e2e/suite.go +++ b/test/e2e/suite.go @@ -34,6 +34,7 @@ import ( porchclient "github.com/nephio-project/porch/api/generated/clientset/versioned" porchapi "github.com/nephio-project/porch/api/porch/v1alpha1" configapi "github.com/nephio-project/porch/api/porchconfig/v1alpha1" + pvapi "github.com/nephio-project/porch/controllers/packagevariants/api/v1alpha1" internalapi "github.com/nephio-project/porch/internal/api/porchinternal/v1alpha1" internalpkg "github.com/nephio-project/porch/internal/kpt/pkg" "github.com/nephio-project/porch/pkg/git" @@ -388,6 +389,7 @@ func createClientScheme(t *testing.T) *runtime.Scheme { coreapi.AddToScheme, aggregatorv1.AddToScheme, appsv1.AddToScheme, + pvapi.AddToScheme, }) { if err := api(scheme); err != nil { t.Fatalf("Failed to initialize test k8s api client")