From 45934a09e6c660eb6b81224253a008712c587f3c Mon Sep 17 00:00:00 2001 From: "crossplane-renovate[bot]" <166709878+crossplane-renovate[bot]@users.noreply.github.com> Date: Thu, 19 Nov 2026 22:29:16 +0000 Subject: [PATCH 1/3] fix(deps): update go dependencies --- go.mod | 90 ++++++++++--------- go.sum | 200 +++++++++++++++++++++--------------------- nix/vendor-hashes.nix | 2 +- 3 files changed, 143 insertions(+), 149 deletions(-) diff --git a/go.mod b/go.mod index ed37a9c3..ce5be13c 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/crossplane/cli/v2 -go 1.26.8 +go 1.27.0 // Use an old version of go-yit, because the latest version (pulled in as a // transitive dependency of oapi-codegen) is incompatible with the YAML library @@ -16,22 +16,22 @@ replace github.com/dprotaso/go-yit => github.com/dprotaso/go-yit v0.0.0-20250513 require ( charm.land/bubbles/v2 v2.2.1 - charm.land/bubbletea/v2 v2.1.1 + charm.land/bubbletea/v2 v2.1.2 charm.land/glamour/v2 v2.0.1 - charm.land/lipgloss/v2 v2.0.6 + charm.land/lipgloss/v2 v2.1.1 dario.cat/mergo v1.0.2 github.com/Masterminds/semver/v3 v3.5.0 github.com/alecthomas/kong v1.17.0 - github.com/charmbracelet/x/ansi v0.11.9 + github.com/charmbracelet/x/ansi v0.11.10 github.com/charmbracelet/x/term v0.2.2 github.com/containerd/errdefs v1.0.0 github.com/crossplane/crossplane-runtime/v2 v2.4.3 github.com/crossplane/crossplane/apis/v2 v2.4.3 github.com/crossplane/function-sdk-go v0.7.1 github.com/crossplane/upjet/v2 v2.5.1-0.20261005082904-c3b7d449d0d4 - github.com/docker/cli v29.9.3+incompatible + github.com/docker/cli v29.10.0+incompatible github.com/emicklei/dot v1.11.0 - github.com/getkin/kin-openapi v0.152.0 + github.com/getkin/kin-openapi v0.153.0 github.com/go-git/go-billy/v5 v5.9.2 github.com/go-git/go-git/v5 v5.19.3 github.com/go-logr/logr v1.4.4 @@ -40,29 +40,28 @@ require ( github.com/google/go-containerregistry v0.22.1 github.com/google/ko v0.19.1 github.com/invopop/jsonschema v0.14.0 - github.com/kubernetes-sigs/kro v0.9.4 - github.com/moby/moby/api v1.56.1 - github.com/moby/moby/client v0.6.2 + github.com/kubernetes-sigs/kro v0.10.0 + github.com/moby/moby/api v1.57.0 + github.com/moby/moby/client v0.6.3 github.com/muesli/termenv v0.16.0 github.com/oapi-codegen/oapi-codegen/v2 v2.8.2 github.com/pkg/errors v0.9.1 github.com/posener/complete v1.2.3 - github.com/sergi/go-diff v1.4.0 + github.com/sergi/go-diff v1.4.5 github.com/shirou/gopsutil/v4 v4.26.10 github.com/spf13/afero v1.15.0 github.com/willabides/kongplete v0.4.0 golang.org/x/crypto v0.59.0 - golang.org/x/mod v0.42.0 - golang.org/x/net v0.62.0 + golang.org/x/mod v0.43.0 + golang.org/x/net v0.63.0 golang.org/x/sync v0.25.0 golang.org/x/sys v0.50.0 golang.org/x/text v0.44.0 - golang.org/x/tools v0.52.0 - google.golang.org/genproto/googleapis/rpc v0.0.0-20260831171406-18b4a7587f8a + golang.org/x/tools v0.53.0 + google.golang.org/genproto/googleapis/rpc v0.0.0-20261104224025-d1e00e9f33ab google.golang.org/grpc v1.85.0 google.golang.org/protobuf v1.36.12 gopkg.in/yaml.v3 v3.0.1 - gotest.tools/v3 v3.5.2 helm.sh/helm/v3 v3.22.1 k8s.io/api v0.37.1 k8s.io/apiextensions-apiserver v0.37.1 @@ -73,7 +72,7 @@ require ( k8s.io/kube-aggregator v0.35.1 k8s.io/kube-openapi v0.0.0-20260821135717-be32def86098 k8s.io/metrics v0.37.1 - k8s.io/utils v0.0.0-20260707023825-cf1189d6abe3 + k8s.io/utils v0.0.0-20261023123148-ca04ba58ecab sigs.k8s.io/controller-runtime v0.24.1 sigs.k8s.io/kind v0.33.0 sigs.k8s.io/structured-merge-diff/v6 v6.4.2 @@ -156,7 +155,7 @@ require ( github.com/dprotaso/go-yit v0.0.0-20260209000607-dfb86291624d // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/ebitengine/purego v0.11.2 // indirect - github.com/emicklei/go-restful/v3 v3.13.0 // indirect + github.com/emicklei/go-restful/v3 v3.14.0 // indirect github.com/emirpasic/gods v1.18.1 // indirect github.com/evanphx/json-patch v5.9.11+incompatible // indirect github.com/evanphx/json-patch/v5 v5.9.11 // indirect @@ -164,7 +163,7 @@ require ( github.com/fatih/color v1.19.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fsnotify/fsnotify v1.10.1 // indirect - github.com/fxamacker/cbor/v2 v2.9.3 // indirect + github.com/fxamacker/cbor/v2 v2.10.0 // indirect github.com/go-chi/chi/v5 v5.4.0 // indirect github.com/go-errors/errors v1.4.2 // indirect github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect @@ -176,26 +175,26 @@ require ( github.com/go-ole/go-ole v1.2.6 // indirect github.com/go-openapi/analysis v0.25.2 // indirect github.com/go-openapi/errors v0.22.7 // indirect - github.com/go-openapi/jsonpointer v1.0.0 // indirect - github.com/go-openapi/jsonreference v1.0.1 // indirect + github.com/go-openapi/jsonpointer v1.0.2 // indirect + github.com/go-openapi/jsonreference v1.0.3 // indirect github.com/go-openapi/loads v0.23.3 // indirect github.com/go-openapi/runtime v0.32.3 // indirect github.com/go-openapi/runtime/server-middleware v0.30.0 // indirect github.com/go-openapi/spec v0.22.5 // indirect github.com/go-openapi/strfmt v0.26.3 // indirect - github.com/go-openapi/swag v0.29.1 // indirect - github.com/go-openapi/swag/cmdutils v0.29.1 // indirect - github.com/go-openapi/swag/conv v0.29.1 // indirect - github.com/go-openapi/swag/fileutils v0.29.1 // indirect + github.com/go-openapi/swag v0.29.2 // indirect + github.com/go-openapi/swag/cmdutils v0.29.2 // indirect + github.com/go-openapi/swag/conv v0.29.2 // indirect + github.com/go-openapi/swag/fileutils v0.29.2 // indirect github.com/go-openapi/swag/jsonname v0.26.0 // indirect - github.com/go-openapi/swag/jsonutils v0.29.1 // indirect - github.com/go-openapi/swag/loading v0.29.1 // indirect - github.com/go-openapi/swag/mangling v0.29.1 // indirect - github.com/go-openapi/swag/netutils v0.29.1 // indirect - github.com/go-openapi/swag/pools v0.29.1 // indirect - github.com/go-openapi/swag/stringutils v0.29.1 // indirect - github.com/go-openapi/swag/typeutils v0.29.1 // indirect - github.com/go-openapi/swag/yamlutils v0.29.1 // indirect + github.com/go-openapi/swag/jsonutils v0.29.2 // indirect + github.com/go-openapi/swag/loading v0.29.2 // indirect + github.com/go-openapi/swag/mangling v0.29.2 // indirect + github.com/go-openapi/swag/netutils v0.29.2 // indirect + github.com/go-openapi/swag/pools v0.29.2 // indirect + github.com/go-openapi/swag/stringutils v0.29.2 // indirect + github.com/go-openapi/swag/typeutils v0.29.2 // indirect + github.com/go-openapi/swag/yamlutils v0.29.2 // indirect github.com/go-openapi/validate v0.25.3 // indirect github.com/go-viper/mapstructure/v2 v2.5.0 // indirect github.com/gobwas/glob v0.2.3 // indirect @@ -233,7 +232,7 @@ require ( github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect github.com/lucasb-eyer/go-colorful v1.4.1 // indirect github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect - github.com/mattn/go-colorable v0.1.15 // indirect + github.com/mattn/go-colorable v0.1.16 // indirect github.com/mattn/go-isatty v0.0.24 // indirect github.com/mattn/go-runewidth v0.0.30 // indirect github.com/microcosm-cc/bluemonday v1.0.27 // indirect @@ -249,11 +248,10 @@ require ( github.com/muesli/cancelreader v0.2.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/nozzle/throttler v0.0.0-20180817012639-2ea982251481 // indirect - github.com/oasdiff/yaml v0.1.1 // indirect - github.com/oasdiff/yaml3 v0.0.14 // indirect github.com/oklog/ulid/v2 v2.1.1 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.1 // indirect + github.com/pandatix/go-abnf v0.5.5 // indirect github.com/pb33f/ordered-map/v2 v2.3.1 // indirect github.com/pelletier/go-toml v1.9.5 // indirect github.com/peterbourgon/diskv v2.0.1+incompatible // indirect @@ -261,10 +259,10 @@ require ( github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20260805114148-88456608a4f6 // indirect - github.com/prometheus/client_golang v1.24.1 // indirect + github.com/prometheus/client_golang v1.25.0 // indirect github.com/prometheus/client_model v0.6.3 // indirect - github.com/prometheus/common v0.71.0 // indirect - github.com/prometheus/procfs v0.22.0 // indirect + github.com/prometheus/common v0.73.1 // indirect + github.com/prometheus/procfs v0.23.0 // indirect github.com/rivo/uniseg v0.4.7 // indirect github.com/riywo/loginshell v0.0.0-20200815045211-7d26008be1ab // indirect github.com/rubenv/sql-migrate v1.8.1 // indirect @@ -317,16 +315,16 @@ require ( go.opentelemetry.io/proto/otlp v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.28.0 // indirect - go.yaml.in/yaml/v2 v2.4.4 // indirect - go.yaml.in/yaml/v3 v3.0.5 // indirect - go.yaml.in/yaml/v4 v4.0.0-rc.6 // indirect + go.yaml.in/yaml/v2 v2.4.5 // indirect + go.yaml.in/yaml/v3 v3.0.6 // indirect + go.yaml.in/yaml/v4 v4.0.0 // indirect golang.org/x/crypto/openpgp v0.1.0-deprecated // indirect - golang.org/x/exp v0.0.0-20260824195058-e88cd73687aa // indirect - golang.org/x/oauth2 v0.36.0 // indirect + golang.org/x/exp v0.0.0-20261014143641-f0251eb4aa3e // indirect + golang.org/x/oauth2 v0.37.0 // indirect golang.org/x/term v0.48.0 // indirect - golang.org/x/time v0.15.0 // indirect + golang.org/x/time v0.16.0 // indirect gomodules.xyz/jsonpatch/v2 v2.5.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260831171406-18b4a7587f8a // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20261104224025-d1e00e9f33ab // indirect gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect @@ -340,7 +338,7 @@ require ( oras.land/oras-go/v2 v2.6.2 // indirect sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.36.0 // indirect sigs.k8s.io/controller-tools v0.20.0 // indirect - sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect + sigs.k8s.io/json v0.0.0-20260909141634-11ed52e25bc5 // indirect sigs.k8s.io/kustomize/api v0.21.1 // indirect sigs.k8s.io/kustomize/kyaml v0.21.1 // indirect sigs.k8s.io/randfill v1.0.0 // indirect diff --git a/go.sum b/go.sum index ddcf2f93..8796f607 100644 --- a/go.sum +++ b/go.sum @@ -4,12 +4,12 @@ cel.dev/expr v0.25.3 h1:A2jO8jwOugrrovveCWfj0KEZOfqiLgAcwjpHPhzIGw0= cel.dev/expr v0.25.3/go.mod h1:hrXvqGP6G6gyx8UAHSHJ5RGk//1Oj5nXQ2NI02Nrsg4= charm.land/bubbles/v2 v2.2.1 h1:Fq1+qm5hV6GkvzLQDhCBpXXE5tLgvh1PRriCLwSvIQU= charm.land/bubbles/v2 v2.2.1/go.mod h1:wdMgn+sje1KNXdwFizIWjbf328fIUBxqEmJ/vYPo8yc= -charm.land/bubbletea/v2 v2.1.1 h1:S1S9l37pCZGrj1JexBcr9x4Nr3MVeM42InqCYM/tDpU= -charm.land/bubbletea/v2 v2.1.1/go.mod h1:xWHeyxIX9/wiFU2kgPW04ojOZyTzrWf+8lGjUCaftiU= +charm.land/bubbletea/v2 v2.1.2 h1:vB3XAcHhLB2gR3HOHpwO3lHB3nbvaowIgL3e5x/DUZo= +charm.land/bubbletea/v2 v2.1.2/go.mod h1:xWHeyxIX9/wiFU2kgPW04ojOZyTzrWf+8lGjUCaftiU= charm.land/glamour/v2 v2.0.1 h1:xl+r00A4aJWU0z8fgwKd9fQQ4rsphqGUzuEiXZP5n+c= charm.land/glamour/v2 v2.0.1/go.mod h1:jo9z8XqVKPeEFMVdvCRLGk++RyJ3CdUwgNr7EvXLw3k= -charm.land/lipgloss/v2 v2.0.6 h1:EaGKeuA8FvF+v2BT5VmZd2LoYLaMZJXA5n34th8nCIQ= -charm.land/lipgloss/v2 v2.0.6/go.mod h1:ipDDJNSGa1hlwDtSfW1s2/xR8Vdhbut4PXh2zEKZd0Q= +charm.land/lipgloss/v2 v2.1.1 h1:F+vKWis9Kz3MFRsbICSDFtT1ZwVL+8f+36Dtg+OpKwc= +charm.land/lipgloss/v2 v2.1.1/go.mod h1:k79y/56yThpkJvbwyrcHr8MyZF42e84Q5fW9Ibu6LFc= cloud.google.com/go v0.123.0 h1:2NAUJwPR47q+E35uaJeYoNhuNEM9kM8SjgRgdeOJUSE= cloud.google.com/go v0.123.0/go.mod h1:xBoMV08QcqUGuPW65Qfm1o9Y4zKZBpGS+7bImXLTAZU= cloud.google.com/go/auth v0.20.0 h1:kXTssoVb4azsVDoUiF8KvxAqrsQcQtB53DcSgta74CA= @@ -180,8 +180,8 @@ github.com/charmbracelet/colorprofile v0.4.3 h1:QPa1IWkYI+AOB+fE+mg/5/4HRMZcaXex github.com/charmbracelet/colorprofile v0.4.3/go.mod h1:/zT4BhpD5aGFpqQQqw7a+VtHCzu+zrQtt1zhMt9mR4Q= github.com/charmbracelet/ultraviolet v0.0.0-20261008173134-6b8d4baf91b4 h1:hISLzUbwcvJbGoNR6A3L/TpguRRnACBmZOee8LcHLJw= github.com/charmbracelet/ultraviolet v0.0.0-20261008173134-6b8d4baf91b4/go.mod h1:aJDVk+WOVM1K04rdc/71PMPoUGfjxjhvXfP3Pjz1Zio= -github.com/charmbracelet/x/ansi v0.11.9 h1:kIrqLBxtTVbLyyHO2Evoi93EjQo1mylWmpNEsfPxXAM= -github.com/charmbracelet/x/ansi v0.11.9/go.mod h1:DG/hpOnaI2QJ/KMMqLL2h0KVhluuJLazf8973P+Vy5w= +github.com/charmbracelet/x/ansi v0.11.10 h1:GjcX3+rAk+8wDX/jY0XwrZstxkjRcLkYU3TvwzZWiRA= +github.com/charmbracelet/x/ansi v0.11.10/go.mod h1:DG/hpOnaI2QJ/KMMqLL2h0KVhluuJLazf8973P+Vy5w= github.com/charmbracelet/x/exp/golden v0.0.0-20250806222409-83e3a29d542f h1:pk6gmGpCE7F3FcjaOEKYriCvpmIN4+6OS/RD0vm4uIA= github.com/charmbracelet/x/exp/golden v0.0.0-20250806222409-83e3a29d542f/go.mod h1:IfZAMTHB6XkZSeXUqriemErjAWCCzT0LwjKFYCZyw0I= github.com/charmbracelet/x/exp/slice v0.0.0-20250327172914-2fdc97757edf h1:rLG0Yb6MQSDKdB52aGX55JT1oi0P0Kuaj7wi1bLUpnI= @@ -257,8 +257,8 @@ github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5Qvfr github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/dlclark/regexp2 v1.11.5 h1:Q/sSnsKerHeCkc/jSTNq1oCm7KiVgUMZRDUoRu0JQZQ= github.com/dlclark/regexp2 v1.11.5/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= -github.com/docker/cli v29.9.3+incompatible h1:SBaMp7ecohadEHMDrUJg22t9I3awqsAVhnJ7GOcWpfE= -github.com/docker/cli v29.9.3+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/cli v29.10.0+incompatible h1:lCL+clBUJnHsmjBCr6TwvfQFkmBidPxi5SkuXCoYxc0= +github.com/docker/cli v29.10.0+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/docker-credential-helpers v0.9.6 h1:cT2PbRPSlnMmNTfT2TDMXRyQ1KMWHG7xoTLBcn1ZNv0= github.com/docker/docker-credential-helpers v0.9.6/go.mod h1:v1S+hepowrQXITkEfw6o4+BMbGot02wiKpzWhGUZK6c= github.com/docker/go-connections v0.8.2 h1:9d9DEokx5W7qlr0shkFXIxEA7+TTD+llwzcykSlxMNc= @@ -279,8 +279,8 @@ github.com/elazarl/goproxy v1.7.2 h1:Y2o6urb7Eule09PjlhQRGNsqRfPmYI3KKQLFpCAV3+o github.com/elazarl/goproxy v1.7.2/go.mod h1:82vkLNir0ALaW14Rc399OTTjyNREgmdL2cVoIbS6XaE= github.com/emicklei/dot v1.11.0 h1:zsrhCuFHAJge/aZIC4N4LdHy5tqYu4tWEaUzIwdYj4Y= github.com/emicklei/dot v1.11.0/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= -github.com/emicklei/go-restful/v3 v3.13.0 h1:C4Bl2xDndpU6nJ4bc1jXd+uTmYPVUwkD6bFY/oTyCes= -github.com/emicklei/go-restful/v3 v3.13.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/emicklei/go-restful/v3 v3.14.0 h1:6V6Ba8/5W1Z7amPinklZeCMlHBMwj53thpfxazCLMX4= +github.com/emicklei/go-restful/v3 v3.14.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= github.com/evanphx/json-patch v5.9.11+incompatible h1:ixHHqfcGvxhWkniF1tWxBHA0yb4Z+d1UQi45df52xW8= @@ -304,10 +304,10 @@ github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbS github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/fsnotify/fsnotify v1.10.1 h1:b0/UzAf9yR5rhf3RPm9gf3ehBPpf0oZKIjtpKrx59Ho= github.com/fsnotify/fsnotify v1.10.1/go.mod h1:TLheqan6HD6GBK6PrDWyDPBaEV8LspOxvPSjC+bVfgo= -github.com/fxamacker/cbor/v2 v2.9.3 h1:oQBnFATpNdY8gJHTndDDv5Xl4QqNaz51G5LLEPhng3Q= -github.com/fxamacker/cbor/v2 v2.9.3/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ= -github.com/getkin/kin-openapi v0.152.0 h1:XRVo77lMRyOGMHf1paMu9lxX3wzuQDZeprssZJnz/x8= -github.com/getkin/kin-openapi v0.152.0/go.mod h1:1+BHDzstro+P5CKtPy1X4PfofnFgmRe6uvMy9+r9fKY= +github.com/fxamacker/cbor/v2 v2.10.0 h1:HVF3T5vYwLqO81ebPirWEPNv2SMrUMD3HLnKgEr6uWE= +github.com/fxamacker/cbor/v2 v2.10.0/go.mod h1:uSwlToFuT9BZAKRxxVm3qQC8DR4tlWl7D6pf20iRYH4= +github.com/getkin/kin-openapi v0.153.0 h1:Qo4qWW+Pj8o90LUTE6MDyG5TJAtWnfvrcWOBcWg7eBw= +github.com/getkin/kin-openapi v0.153.0/go.mod h1:mEZ6Ip3gyqPDokUsJsttZhv3r46/NeH3tGwrFUMcoSE= github.com/gliderlabs/ssh v0.3.8 h1:a4YXD1V7xMF9g5nTkdfnja3Sxy1PVDCj1Zg4Wb8vY6c= github.com/gliderlabs/ssh v0.3.8/go.mod h1:xYoytBv1sV0aL3CavoDuJIQNURXkkfPA/wxQ1pL1fAU= github.com/go-chi/chi/v5 v5.4.0 h1:+ufzvFTGKyin26Or5DLrlIDq4ygIDBVcj7oVNeeaYFE= @@ -345,10 +345,10 @@ github.com/go-openapi/analysis v0.25.2 h1:I0vy4n3alz+DHTiN1PRhCb7QZxkK6g5YmswZKv github.com/go-openapi/analysis v0.25.2/go.mod h1:Uhs1t/2XR10EnwONYILGEzw8gcfGIG5Xk5K2AxnhqDo= github.com/go-openapi/errors v0.22.7 h1:JLFBGC0Apwdzw3484MmBqspjPbwa2SHvpDm0u5aGhUA= github.com/go-openapi/errors v0.22.7/go.mod h1://QW6SD9OsWtH6gHllUCddOXDL0tk0ZGNYHwsw4sW3w= -github.com/go-openapi/jsonpointer v1.0.0 h1:kR9tHqY0CtZaOPVFm622dPVNhrvYpwr4uCxgL3h1H8s= -github.com/go-openapi/jsonpointer v1.0.0/go.mod h1:Z3rw7dWu1p9IgitXCFamSlA5lmDiklEB6vkaxcNZW5Y= -github.com/go-openapi/jsonreference v1.0.1 h1:4zJ7AmYDKNmD3aSpfPnFNCFA5E80/xMHUNKgydaLh38= -github.com/go-openapi/jsonreference v1.0.1/go.mod h1:dYplQXa6p5lXprLcJ8LE2iU7vNpXsAHDQ5ZAgL+Qx3A= +github.com/go-openapi/jsonpointer v1.0.2 h1:NbW7xT2b+l7x+JefiPGDsZWsrLk1ogrz4AHK1TTzMt8= +github.com/go-openapi/jsonpointer v1.0.2/go.mod h1:N0rI4MbNKD7xAFTiHtB+5Nhrg2j/wwYg7m7Fmb4/jk8= +github.com/go-openapi/jsonreference v1.0.3 h1:5rDbq+JsjCv6/nUDDJt83nLZoADI4w03uvHXer+4aYQ= +github.com/go-openapi/jsonreference v1.0.3/go.mod h1:OJSlMXHysgH272D9z2tiy2MGe5A9vQLHaCPb6KbYdE4= github.com/go-openapi/loads v0.23.3 h1:g5Xap1JfwKkUnZdn+S0L3SzBDpcTIYzZ5Qaag0YDkKQ= github.com/go-openapi/loads v0.23.3/go.mod h1:NOH07zLajXo8y55hom0omlHWDVVvCwBM/S+csCK8LqA= github.com/go-openapi/runtime v0.32.3 h1:J7Ycy5DJmhhP1By3NifhRUjnkXTrk21qbeqSULjwX8U= @@ -359,38 +359,38 @@ github.com/go-openapi/spec v0.22.5 h1:KhO7RBlKQfonUWX2WzQCoLIXVA6AcNqDGZ3a1Dutdl github.com/go-openapi/spec v0.22.5/go.mod h1:vxpOtMya5TXtENXKE5bKqv5NjocVhyhxHrlZfvKnZ74= github.com/go-openapi/strfmt v0.26.3 h1:rzmslHarJgBbf2qfGge+X3htclQfmXqBZMm0Too0HhU= github.com/go-openapi/strfmt v0.26.3/go.mod h1:a5nsUw0oRpQzZeOwx8bi6cKbzFZslpbCKt1LEot+KnQ= -github.com/go-openapi/swag v0.29.1 h1:C6EeWzUwQtcWEhE9eqBdUubGXxhWY4PlzHMLD7kLaiQ= -github.com/go-openapi/swag v0.29.1/go.mod h1:BzxEXKiPlSXRsRTv1KSBF/BpGKHxA/YciCnr4tv9bvA= -github.com/go-openapi/swag/cmdutils v0.29.1 h1:3DorPGfUdE80BogKY22EzoHBcHMrkVomZMoV7kS4ANY= -github.com/go-openapi/swag/cmdutils v0.29.1/go.mod h1:Sm1MVFMkF6guJJ+pQqHnQA3N0j9qALV3NxzDSv6bETM= -github.com/go-openapi/swag/conv v0.29.1 h1:AC4Eh/5c/eUDOUCzzsRC9ghmFgOSBHeRMGIngY0ZUGA= -github.com/go-openapi/swag/conv v0.29.1/go.mod h1:S1X7/ZrBEZOC0Wc8AGxjbcGS92l3WEjA7aPtpl+RaqM= -github.com/go-openapi/swag/fileutils v0.29.1 h1:ZcPzMceVhU1WPbK6N1G6sNQKdd1CWJlf3cA08UHuoM0= -github.com/go-openapi/swag/fileutils v0.29.1/go.mod h1:/wofKYckbtRl2p3+EwQsosie5CT1B38+dQ+PS579BzI= +github.com/go-openapi/swag v0.29.2 h1:9n8frkcsuQRA0INU31VbxNxt1zBaHxrHYGEf5BUjFi4= +github.com/go-openapi/swag v0.29.2/go.mod h1:RkCiX1gCVXWgLOavDXE3ALJrQ/VO2ziiIzOUs3z10xo= +github.com/go-openapi/swag/cmdutils v0.29.2 h1:cXEzX/nWCODon251f+1HgL75/R4XXML5IZxgLCWMoro= +github.com/go-openapi/swag/cmdutils v0.29.2/go.mod h1:XziaSVzYqkDvpWXzASfWajw2YvJrLscq610O2XiyqJw= +github.com/go-openapi/swag/conv v0.29.2 h1:8c9shoB8l0QRSR6ymq1llHdBWDqpIgJfjTGHx3Vuhm0= +github.com/go-openapi/swag/conv v0.29.2/go.mod h1:AZS0YigTNf8qNtD6WqJz/N4RUNmpr76SyjFGkq4+p6Q= +github.com/go-openapi/swag/fileutils v0.29.2 h1:mdUL+Vw5ah1fO1AvFCoHeIyv7YZsCz2MN3KNqd/lLVI= +github.com/go-openapi/swag/fileutils v0.29.2/go.mod h1:7QKmmodjAebaq61lGVJa8ldLdGeMF4DSgYv8tXOGGo0= github.com/go-openapi/swag/jsonname v0.26.0 h1:gV1NFX9M8avo0YSpmWogqfQISigCmpaiNci8cGECU5w= github.com/go-openapi/swag/jsonname v0.26.0/go.mod h1:urBBR8bZNoDYGr653ynhIx+gTeIz0ARZxHkAPktJK2M= -github.com/go-openapi/swag/jsonutils v0.29.1 h1:AFCxs0eQZ24/QyfhVHM2t49rMz7Vv3XCsZQI6yrNy+c= -github.com/go-openapi/swag/jsonutils v0.29.1/go.mod h1:u3+sCfJpttDpcmS5kpm0yxL6GK0eWgODsx8Yw8fcqNM= -github.com/go-openapi/swag/jsonutils/fixtures_test v0.29.1 h1:BiiXE31Bx9SfpsMmOQj5KYpUhTZBpLVriVhJDuLuY2o= -github.com/go-openapi/swag/jsonutils/fixtures_test v0.29.1/go.mod h1:julgTUKZ9/D0j6O7GKajmRs+812FWxQg/mMpGunWSjg= -github.com/go-openapi/swag/loading v0.29.1 h1:FCv5fG8UhTdDJa2R7w+5O9Ekpcbw7tt0nFWvmDKGBjc= -github.com/go-openapi/swag/loading v0.29.1/go.mod h1:N0ESuem4p2oedKal8EJhciqnJ9Q9Wmt83L1CRB3Fouw= -github.com/go-openapi/swag/mangling v0.29.1 h1:lHALtvYCdxVnRl4GrHmFPwfBTZYIObqdGNSKyu/8D6I= -github.com/go-openapi/swag/mangling v0.29.1/go.mod h1:SAop9pB7PUjQ/CGCNf/JmCKTRK+GDO+RqE9UHqC/N6s= -github.com/go-openapi/swag/netutils v0.29.1 h1:IjIvdEP5duKcghFqJEPSUraRnkKYHoM65kTluTu+Jb4= -github.com/go-openapi/swag/netutils v0.29.1/go.mod h1:DUde7x4Bx00k5jYl2AdRpNAO0m7atUvD2x6X+bWkbno= -github.com/go-openapi/swag/pools v0.29.1 h1:NRogYxdEW9SjRM4mkAOji9iefO4MRXq3p/ZJcoQbUKg= -github.com/go-openapi/swag/pools v0.29.1/go.mod h1:leDcaghjkRAhCuCRv9NfJU5f0mjoU3cT/XZObhMk3pc= -github.com/go-openapi/swag/stringutils v0.29.1 h1:1ykunK7iJQk1uOO7+oUH1ukbsK85fFCOiCFMOVSY+F0= -github.com/go-openapi/swag/stringutils v0.29.1/go.mod h1:7fSqZ+z8Qc0tOfAAK0jVa5qFGrnIlRi6n7NeGGrr1vc= -github.com/go-openapi/swag/typeutils v0.29.1 h1:Nzv9nhnlLCRBPQqfOX+7lB6Guju370or8StT+lIOf6M= -github.com/go-openapi/swag/typeutils v0.29.1/go.mod h1:hxpgDZJVBkBsi/d3MIUosafoFdE5exaQRmVp0zwu3YE= -github.com/go-openapi/swag/yamlutils v0.29.1 h1:69w3tsBajm7MR/fejLy7HD/3J68Ys1SeeZMEzZ3w2sk= -github.com/go-openapi/swag/yamlutils v0.29.1/go.mod h1:rgsp3vT/QdWzKwn43CigDwjOGIenPyTZMKnxEM8jZOA= -github.com/go-openapi/testify/enable/yaml/v2 v2.6.1 h1:Jm+/ze2rMtbD98yen92AhATGLGREDYXG56Xr4gMjEtE= -github.com/go-openapi/testify/enable/yaml/v2 v2.6.1/go.mod h1:YDPnwCRDu38/oJBVMBVXOUDiJ9cIeBHWvfImHaXqnv4= -github.com/go-openapi/testify/v2 v2.6.1 h1:6CNJhTjMzgaeaH8WhshcsZNPIvRemiOcFpU7seO/y7Q= -github.com/go-openapi/testify/v2 v2.6.1/go.mod h1:SgsVHtfooshd0tublTtJ50FPKhujf47YRqauXXOUxfw= +github.com/go-openapi/swag/jsonutils v0.29.2 h1:uZNSD2/rJDYAfvsLYkykTzXuyxM3QpDKV9jhRHrMu6k= +github.com/go-openapi/swag/jsonutils v0.29.2/go.mod h1:ONTdNvj3Y+IXRzfa17E+Rgt2ns/qiSOYjIo2K7v2yDs= +github.com/go-openapi/swag/jsonutils/fixtures_test v0.29.2 h1:w+Fd6EBOMGlC74GYGHqCLGyb3Bpams8TtNrgM/SG4jo= +github.com/go-openapi/swag/jsonutils/fixtures_test v0.29.2/go.mod h1:HC2egPORFzbj/gf05Zrfgz8Mgplx3oW7hgGi7pjZVhM= +github.com/go-openapi/swag/loading v0.29.2 h1:QU1ry24e6r6Shoxe380Nx0X5iKkpRO+hJffsyJ2dVlY= +github.com/go-openapi/swag/loading v0.29.2/go.mod h1:DqilDjuiJKETecsS4TRopWG1acUDsfqN39ZmQhPu6uI= +github.com/go-openapi/swag/mangling v0.29.2 h1:ltdo3K0tTP4P6zWhVVWDU9D37/YYBuMJRdZxiS2Dtog= +github.com/go-openapi/swag/mangling v0.29.2/go.mod h1:RjDi4TnItAenS3cgCXSpIl1kKbjG7il6pnmQVl/8bp8= +github.com/go-openapi/swag/netutils v0.29.2 h1:dBli6jyUa93sDS/XYWShJzf4+nnVfFKfvY9SLUaUzB8= +github.com/go-openapi/swag/netutils v0.29.2/go.mod h1:1pM6Xg/Um8E1eps3umWl8Hme3ByWXOtHsvFC0CULHUE= +github.com/go-openapi/swag/pools v0.29.2 h1:PlGoDRF8WtSyXkedZZkpW3f9wDhFf3u8KtaBcmgmh8c= +github.com/go-openapi/swag/pools v0.29.2/go.mod h1:V3lhxVT4qDYRqc2MRSSbLsTYIYV/2HlHafhyEkmzLIc= +github.com/go-openapi/swag/stringutils v0.29.2 h1:lcnBxwAaysT3bMUVBfn9V/PkfVqkurpqufKU6rTUMGk= +github.com/go-openapi/swag/stringutils v0.29.2/go.mod h1:i9cdh7sGaa0nm3CqIvH5IM5h2QClk1wns2ktKeILvRI= +github.com/go-openapi/swag/typeutils v0.29.2 h1:O7aVvkTs3pXwikgtrPLenigEMdQFgONKRooQA9pgf2I= +github.com/go-openapi/swag/typeutils v0.29.2/go.mod h1:7+GDG+uz9Ke+eVt4rClZg7wklSDp8hT/mKNh/pC26TE= +github.com/go-openapi/swag/yamlutils v0.29.2 h1:IFKFFeDnuIwzfsuWRQU+rI8iL3g4XyAYjV/RlnlxPLM= +github.com/go-openapi/swag/yamlutils v0.29.2/go.mod h1:7MGqtcrK73sxQ4ceiyIf8qiXS/s09JLMdR5esK5euYQ= +github.com/go-openapi/testify/enable/yaml/v2 v2.7.0 h1:wPW6YRgx3+SID1yUy/Xwa17L8kFEaEKod2VRbJDZNUs= +github.com/go-openapi/testify/enable/yaml/v2 v2.7.0/go.mod h1:mI1M88etYbc3PhgHsWQK2kwvNwW5aGFqMPbmib+SGIs= +github.com/go-openapi/testify/v2 v2.8.0 h1:19QDx5b57p8KjO2E4sgs/woL4Akp+FGLRlVm2xn0Rho= +github.com/go-openapi/testify/v2 v2.8.0/go.mod h1:4gUN8jC+RqOE2qjW/vDmfyTvl5BCht4qL7oca0odrak= github.com/go-openapi/validate v0.25.3 h1:4nzAIavcJ7WveHK2+V1UAkZK3kWcjzxZCzjfZAfavKs= github.com/go-openapi/validate v0.25.3/go.mod h1:GemfuGMyYpIaBoKpX3z8sLywrmxpzWVOoJ7R0VeAVuk= github.com/go-rod/rod v0.116.2 h1:A5t2Ky2A+5eD/ZJQr1EfsQSe5rms5Xof/qj296e+ZqA= @@ -473,8 +473,8 @@ github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6/go.mod h1:kf6iHlnVGwg github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= -github.com/google/pprof v0.0.0-20260830191439-4932ad3515ea h1:nItRa0lOM9n5+PZiNPdBI2RjLCZoBrhWqKDJuB3+gSU= -github.com/google/pprof v0.0.0-20260830191439-4932ad3515ea/go.mod h1:jl5iWTm0/hd5PjEYEOuwAJ57L/CibdZfrqZ5XA5GrCk= +github.com/google/pprof v0.0.0-20261105003125-4bf881d7fb0b h1:5NKFt6kcAJNVt3XBOf8jwp8TnWZVOZFmmGkK0XextI4= +github.com/google/pprof v0.0.0-20261105003125-4bf881d7fb0b/go.mod h1:yUo1AMMpsPIDFGuwDK8nLcf8+vvAd5l2O6JDZ6hpwrM= github.com/google/s2a-go v0.1.9 h1:LGD7gtMgezd8a/Xak7mEWL0PjoTQFvpRudN895yqKW0= github.com/google/s2a-go v0.1.9/go.mod h1:YA0Ei2ZQL3acow2O62kdp9UlnvMmU7kA6Eutn0dXayM= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= @@ -572,8 +572,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kubernetes-sigs/kro v0.9.4 h1:gynhldCLYW5x+M0c2Bf1ihoQTpNE68SKiXl1f6aX1kk= -github.com/kubernetes-sigs/kro v0.9.4/go.mod h1:41SwnJsWRNxbDM/iHwsdamnyPV/p7/nReiI1OckeVrk= +github.com/kubernetes-sigs/kro v0.10.0 h1:3Jm8nZm4+bh6NYYaHQ/EOOFg0gApwHVYqDNfLuj1ioY= +github.com/kubernetes-sigs/kro v0.10.0/go.mod h1:YozwLf5brEcsTr8CcKH+LhQyXNZDNpqR3afiOOw6a7w= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 h1:SOEGU9fKiNWd/HOJuq6+3iTQz8KNCLtVX6idSoTLdUw= @@ -593,8 +593,8 @@ github.com/lucasb-eyer/go-colorful v1.4.1/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/mattn/go-colorable v0.1.15 h1:+u9SLTRGnXv73cEsnsmoZBom+dMU88B2M0aDcWy0/jY= -github.com/mattn/go-colorable v0.1.15/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= +github.com/mattn/go-colorable v0.1.16 h1:+2YjeAe7xP1OQbZW1jERPWWCDLlNqFNCvjiqGiAt84A= +github.com/mattn/go-colorable v0.1.16/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= github.com/mattn/go-isatty v0.0.24 h1:tGZZoVgT/KiqK1c8ocVLeDS8BSWMRd47J3Lbz7vsReI= github.com/mattn/go-isatty v0.0.24/go.mod h1:nMCL3Zebbrt45jsMDgnfIwz6ydEQApk5oEI3HqDio6A= github.com/mattn/go-runewidth v0.0.30 h1:+KUuiDA4fF0R1p5FeueHefjDm+GIM+kWfFnDjybOPgk= @@ -618,10 +618,10 @@ github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zx github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0= github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo= -github.com/moby/moby/api v1.56.1 h1:PpWkvVPB7Fr/No8w+TfyJ/I6rWZ2YPZhT3JorIg+06c= -github.com/moby/moby/api v1.56.1/go.mod h1:sZ+THbVWkjOmBPPfbnzdD/G1LuIexWhqlSHHPTDQ1Uk= -github.com/moby/moby/client v0.6.2 h1:ekSPlMccrZGcw6Scb8T9D39qE0mB+XupU/yS0zNw9N4= -github.com/moby/moby/client v0.6.2/go.mod h1:DGcnO7qmPJrqobx/ggQgQ/AUk+2wgVdQv7uxB0/mEsc= +github.com/moby/moby/api v1.57.0 h1:K2ykv5UZjwFCtmtL486T+SUEVrQ46w3v7isf214RCcw= +github.com/moby/moby/api v1.57.0/go.mod h1:pRZ1QRtx6AVhdckeFYo4DUX4ASNF0SCllhyY6aj2mgg= +github.com/moby/moby/client v0.6.3 h1:XJn2T8YdXBdMgQl7JrOx09NEBuzIpVXcsN2KDHufAKY= +github.com/moby/moby/client v0.6.3/go.mod h1:7CXNAnAhcwwqjwjXqLembJczRorLfM+5mu0d5363lCc= github.com/moby/term v0.5.2 h1:6qk3FJAFDs6i/q3W/pQ97SX192qKfZgGjCQqfCJkgzQ= github.com/moby/term v0.5.2/go.mod h1:d3djjFCrjnB+fl8NJux+EJzu0msscUP+f8it8hPkFLc= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -648,10 +648,6 @@ github.com/nxadm/tail v1.4.11 h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY= github.com/nxadm/tail v1.4.11/go.mod h1:OTaG3NK980DZzxbRq6lEuzgU+mug70nY11sMd4JXXHc= github.com/oapi-codegen/oapi-codegen/v2 v2.8.2 h1:68UGCFId8tysEuz1jqDgem0Lnz0d6T+73br+KwH/W6k= github.com/oapi-codegen/oapi-codegen/v2 v2.8.2/go.mod h1:yae2TI9IYB5vxQ35gFrpXh9L5H1eJv4MAUK1jumGMTo= -github.com/oasdiff/yaml v0.1.1 h1:6nHx+pn9gBRM6YpBlFZFQGCCd1nuvqOBtTD3KKTgGxY= -github.com/oasdiff/yaml v0.1.1/go.mod h1:EYJNoyktvWMJ0Hmhx+6qTaqMOsalUaRGT8Sj1hNcegU= -github.com/oasdiff/yaml3 v0.0.14 h1:aLJee3hxBK2H5wdXd9iPcIXb93Nty1Ge0pT171eHtkw= -github.com/oasdiff/yaml3 v0.0.14/go.mod h1:csto2xfDjYccdUn/yw/bPjj/cYTdp6HtFA0J4TWG+gg= github.com/oklog/ulid/v2 v2.1.1 h1:suPZ4ARWLOJLegGFiZZ1dFAkqzhMjL3J1TzI+5wHz8s= github.com/oklog/ulid/v2 v2.1.1/go.mod h1:rcEKHmBBKfef9DhnvX7y1HZBYxjXb0cP5ExxNsTT1QQ= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -680,8 +676,8 @@ github.com/onsi/ginkgo/v2 v2.19.0/go.mod h1:rlwLi9PilAFJ8jCg9UE1QP6VBpd6/xj3SRC0 github.com/onsi/ginkgo/v2 v2.20.1/go.mod h1:lG9ey2Z29hR41WMVthyJBGUBcBhGOtoPF2VFMvBXFCI= github.com/onsi/ginkgo/v2 v2.22.1/go.mod h1:S6aTpoRsSq2cZOd+pssHAlKW/Q/jZt6cPrPlnj4a1xM= github.com/onsi/ginkgo/v2 v2.23.3/go.mod h1:zXTP6xIp3U8aVuXN8ENK9IXRaTjFnpVB9mGmaSRvxnM= -github.com/onsi/ginkgo/v2 v2.32.1 h1:6tlvcDm/3sE8lGJbZ4+d4mO3RLy24/tQWOFzVSQNIfw= -github.com/onsi/ginkgo/v2 v2.32.1/go.mod h1:+aXOY+vzZ5mu2iI2HpTZUPmM//oQfsNFX6gU9kNcA44= +github.com/onsi/ginkgo/v2 v2.34.0 h1:aN3Us823mHHTSWMIi8WIQTdYuSPhl2lWY46E/w3SiAk= +github.com/onsi/ginkgo/v2 v2.34.0/go.mod h1:+aXOY+vzZ5mu2iI2HpTZUPmM//oQfsNFX6gU9kNcA44= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= @@ -706,13 +702,15 @@ github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeD github.com/onsi/gomega v1.36.1/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog= github.com/onsi/gomega v1.36.2/go.mod h1:DdwyADRjrc825LhMEkD76cHR5+pUnjhUN8GlHlRPHzY= github.com/onsi/gomega v1.37.0/go.mod h1:8D9+Txp43QWKhM24yyOBEdpkzN8FvJyAwecBgsU4KU0= -github.com/onsi/gomega v1.43.0 h1:VlG/1FxqNxhSO+lq/OHBNaaqwiBK/mO8JbVkX9Y+FeU= -github.com/onsi/gomega v1.43.0/go.mod h1:REff/hsDsodHoKlWsP2mAPhu1+5/6hVYNf9rIEBpeSg= +github.com/onsi/gomega v1.44.0 h1:eAiGl3Pw5jz5GQdDff0BcxYpAX1JxW8xD7mFUuwNfZQ= +github.com/onsi/gomega v1.44.0/go.mod h1:e/C2HwaZ1DhvjzXXuFhcR7hY7Sh9pl7MmoWKEjzwcdA= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJwooC2xJA040= github.com/opencontainers/image-spec v1.1.1/go.mod h1:qpqAh3Dmcf36wStyyWU+kCeDgrGnAve2nCC8+7h8Q0M= github.com/orisano/pixelmatch v0.0.0-20220722002657-fb0b55479cde/go.mod h1:nZgzbfBr3hhjoZnS66nKrHmduYNpc34ny7RK4z5/HM0= +github.com/pandatix/go-abnf v0.5.5 h1:EXex5KkRQx4Dm6GnpAcQnIMBs9KiK0uf8p/wq+4t9PM= +github.com/pandatix/go-abnf v0.5.5/go.mod h1:AE0KD3/VNoCjGzc1gqetRKshbI4SYErXQ/8kPenR5mc= github.com/pb33f/ordered-map/v2 v2.3.1 h1:5319HDO0aw4DA4gzi+zv4FXU9UlSs3xGZ40wcP1nBjY= github.com/pb33f/ordered-map/v2 v2.3.1/go.mod h1:qxFQgd0PkVUtOMCkTapqotNgzRhMPL7VvaHKbd1HnmQ= github.com/pborman/getopt v0.0.0-20170112200414-7148bc3a4c30/go.mod h1:85jBQOZwpVEaDAr341tbn15RS4fCAsIst0qp7i8ex1o= @@ -735,16 +733,16 @@ github.com/power-devops/perfstat v0.0.0-20260805114148-88456608a4f6 h1:jL3a8soXd github.com/power-devops/perfstat v0.0.0-20260805114148-88456608a4f6/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/poy/onpar v1.1.2 h1:QaNrNiZx0+Nar5dLgTVp5mXkyoVFIbepjyEoGSnhbAY= github.com/poy/onpar v1.1.2/go.mod h1:6X8FLNoxyr9kkmnlqpK6LSoiOtrO6MICtWwEuWkLjzg= -github.com/prometheus/client_golang v1.24.1 h1:JnJkREXzWxUdCuPFpIWZiPispT9xVV59uiuyR2bPlnU= -github.com/prometheus/client_golang v1.24.1/go.mod h1:F+oSRECHg4sse5ucfYpYDeIv/hu68Zo0uoHKetWnzcE= +github.com/prometheus/client_golang v1.25.0 h1:cDtW1TcFsMi1RJc8khwCKB4VhzwV04aKqbYtNOXuiK0= +github.com/prometheus/client_golang v1.25.0/go.mod h1:j2X/4/kaQHLPnmyEU8zjmkndo1T317VpCIQEml8LTKk= github.com/prometheus/client_model v0.6.3 h1:O0jaTVAYNxTHYInEPFJt5I3+sN8zqBtVMPTB1qyxiEo= github.com/prometheus/client_model v0.6.3/go.mod h1:gpN5P9S7Rr6Yr92PiQ+Ixvhf6JZEkF1dnxsYL2aPBEM= -github.com/prometheus/common v0.71.0 h1:9KDAKb7Mj3HEVKyFCK6Dc/HIwlBzZIN2l7/lrHl3KK8= -github.com/prometheus/common v0.71.0/go.mod h1:CLJ5H8TEsGX8bl31BdMkfhIZ+QmZ9tBPPotUxUbfcmk= +github.com/prometheus/common v0.73.1 h1:SZWh/j4AvhCdhX8jvYSnxvPxhWlC9QZkjJ+tOrEr7kU= +github.com/prometheus/common v0.73.1/go.mod h1:I9aA/Ukz9s1olOobh8KtCkU7B1mQPQsB9UvQPsUQ1Dk= github.com/prometheus/otlptranslator v1.0.0 h1:s0LJW/iN9dkIH+EnhiD3BlkkP5QVIUVEoIwkU+A6qos= github.com/prometheus/otlptranslator v1.0.0/go.mod h1:vRYWnXvI6aWGpsdY/mOT/cbeVRBlPWtBNDb7kGR3uKM= -github.com/prometheus/procfs v0.22.0 h1:6q9+/JL9IKAPbCmBrv9n5O5Ty3NKnciV5X7YGw0oics= -github.com/prometheus/procfs v0.22.0/go.mod h1:CvmFr/GVhIjIvWJZW3tgkODBQMRIf0EyWMQLHCHab58= +github.com/prometheus/procfs v0.23.0 h1:ad+S6FTkzwaMgacKLM5h6bNKExS+DMH0YiUwXItH/o4= +github.com/prometheus/procfs v0.23.0/go.mod h1:3AVXO0FqLafyYFU/V/IQRZlC8Rgqz8Dm/x6pKLK+RIk= github.com/redis/go-redis/extra/rediscmd/v9 v9.5.3 h1:1/BDligzCa40GTllkDnY3Y5DTHuKCONbB2JcRyIfl20= github.com/redis/go-redis/extra/rediscmd/v9 v9.5.3/go.mod h1:3dZmcLn3Qw6FLlWASn1g4y+YO9ycEFUOM+bhBmzLVKQ= github.com/redis/go-redis/extra/redisotel/v9 v9.5.3 h1:kuvuJL/+MZIEdvtb/kTBRiRgYaOmx1l+lYJyVdrRUOs= @@ -772,8 +770,8 @@ github.com/sassoftware/relic/v7 v7.6.2/go.mod h1:kjmP0IBVkJZ6gXeAu35/KCEfca//+PK github.com/secure-systems-lab/go-securesystemslib v0.11.0 h1:iuCR9kcMFD4QurdKrGvPLoKZLv9YvwPYVr0473BdtFs= github.com/secure-systems-lab/go-securesystemslib v0.11.0/go.mod h1:+PMOTjUGwHj2vcZ+TFKlb1tXRbrdWE1LYDT5i9JC80Q= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= -github.com/sergi/go-diff v1.4.0 h1:n/SP9D5ad1fORl+llWyN+D6qoUETXNZARKjyY2/KVCw= -github.com/sergi/go-diff v1.4.0/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4= +github.com/sergi/go-diff v1.4.5 h1:3LvhZn2aCAWagLwIhga3BZiEZ82j5+oQ0vKDwkhjHCI= +github.com/sergi/go-diff v1.4.5/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4= github.com/shibumi/go-pathspec v1.3.0 h1:QUyMZhFo0Md5B8zV8x2tesohbb5kfbpTi9rBnKh5dkI= github.com/shibumi/go-pathspec v1.3.0/go.mod h1:Xutfslp817l2I1cZvgcfeMQJG5QnU2lh5tVaaMCl3jE= github.com/shirou/gopsutil/v4 v4.26.10 h1:MJN6euesJx53MVEjscYeyRSRcrdIcy3sz5k9nosjldg= @@ -962,13 +960,13 @@ go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.28.0 h1:IZzaP1Fv73/T/pBMLk4VutPl36uNC+OSUh3JLG3FIjo= go.uber.org/zap v1.28.0/go.mod h1:rDLpOi171uODNm/mxFcuYWxDsqWSAVkFdX4XojSKg/Q= -go.yaml.in/yaml/v2 v2.4.4 h1:tuyd0P+2Ont/d6e2rl3be67goVK4R6deVxCUX5vyPaQ= -go.yaml.in/yaml/v2 v2.4.4/go.mod h1:gMZqIpDtDqOfM0uNfy0SkpRhvUryYH0Z6wdMYcacYXQ= +go.yaml.in/yaml/v2 v2.4.5 h1:a5nxWvYi94DRl6QSLlTbLpVmutgx2qg8EVjnJtuFpwI= +go.yaml.in/yaml/v2 v2.4.5/go.mod h1:gMZqIpDtDqOfM0uNfy0SkpRhvUryYH0Z6wdMYcacYXQ= go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= -go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw= -go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg= -go.yaml.in/yaml/v4 v4.0.0-rc.6 h1:1h7H1ohdUh93/FyE4YaDa1Zh64K6VVbjF4K6WUxMtH4= -go.yaml.in/yaml/v4 v4.0.0-rc.6/go.mod h1:aZqd9kCMsGL7AuUv/m/PvWLdg5sjJsZ4oHDEnfPPfY0= +go.yaml.in/yaml/v3 v3.0.6 h1:zcDfvjXEqTQmpjniUBLc91xYJMB2c4QOFxEF/LCEckM= +go.yaml.in/yaml/v3 v3.0.6/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg= +go.yaml.in/yaml/v4 v4.0.0 h1:/LG1pNO84Z4l603j/xMn69CcS5OYhMQ/f7l2LoQUGuw= +go.yaml.in/yaml/v4 v4.0.0/go.mod h1:aZqd9kCMsGL7AuUv/m/PvWLdg5sjJsZ4oHDEnfPPfY0= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 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= @@ -998,8 +996,8 @@ golang.org/x/crypto v0.59.0/go.mod h1:veDyUwATGs3c+vN3VfTbzViMGXeTBk3WyhBOkn+F/4 golang.org/x/crypto/openpgp v0.1.0-deprecated h1:T+duersHJVuH6qLtQk22qtGKH5vZhxGSlL5SMFHclaQ= golang.org/x/crypto/openpgp v0.1.0-deprecated/go.mod h1:KQF17hRm+yCzhnZa+aRLbinf2TRZa+7G3TeEnHj6OoY= golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= -golang.org/x/exp v0.0.0-20260824195058-e88cd73687aa h1:QSyA8ishJCyT21kER9KwNt0b7BM3iRK4x9QXhjN5Fdk= -golang.org/x/exp v0.0.0-20260824195058-e88cd73687aa/go.mod h1:zeBbvyFKDaLwa7CH/zI8KXt7gTl14SF7sO08Pl5jBCM= +golang.org/x/exp v0.0.0-20261014143641-f0251eb4aa3e h1:HgI6W1OolKK6tcV74is+rl9SMT0njsHlp0TbQiGXI/A= +golang.org/x/exp v0.0.0-20261014143641-f0251eb4aa3e/go.mod h1:DBoxwWhjaW8DJJw/YeM4zpeOKMC1FMXSblsYy+1mFSw= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= @@ -1016,8 +1014,8 @@ golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/mod v0.23.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= -golang.org/x/mod v0.42.0 h1:ICeL3t2L30ljSPHHxDnR4fqVcBt/zR2zJAb9juavmQg= -golang.org/x/mod v0.42.0/go.mod h1:u5fzIrRInkL8MaO1cbRkUHT64v303YIT5KEqpNr7jRs= +golang.org/x/mod v0.43.0 h1:MFuq5J6s35W9D3IjkwyWc9vHh0nENOrt5K8Iof4ofmg= +golang.org/x/mod v0.43.0/go.mod h1:4ec1JnuyBz5+FIVhg86UsA39YG8BpnrZdJYSNHmGzHY= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -1056,10 +1054,10 @@ golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk= golang.org/x/net v0.37.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= -golang.org/x/net v0.62.0 h1:18ELalfM5+XNRwzM2nYqXsZQ9ByS1uhj2O/U7+5jqRY= -golang.org/x/net v0.62.0/go.mod h1:WgDCOTH8iwtB66T4/GfI94AHo/hhdb7Hah9NDseQfiI= -golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs= -golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7Q= +golang.org/x/net v0.63.0 h1:HCoTmNh9EpD1PpK8gBNFY4gcTY4N+KQEO8ylfIKqFJ0= +golang.org/x/net v0.63.0/go.mod h1:15JLg3IX1bLjHK264EZQEbIpTiR/KVLuo9CTRWd0pig= +golang.org/x/oauth2 v0.37.0 h1:JUlcxA8oAtauLfiH8FX2/FkAWHAdi0QtGCGc+hofE98= +golang.org/x/oauth2 v0.37.0/go.mod h1:IxwZNxUULJmpBFf9K/9NTMSIfZZuvuTy1gGxhigP/58= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1181,8 +1179,8 @@ golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= golang.org/x/text v0.44.0 h1:YItdp/mQNGnsmrgpcdA5yQ3bnRxCfo/Tj/iByGW9GGo= golang.org/x/text v0.44.0/go.mod h1:S4FR1waQ9LbjQTls97SyRjDaUUVkaM+cXwwuG/G+MwY= -golang.org/x/time v0.15.0 h1:bbrp8t3bGUeFOx08pvsMYRTCVSMk89u4tKbNOZbp88U= -golang.org/x/time v0.15.0/go.mod h1:Y4YMaQmXwGQZoFaVFk4YpCt4FLQMYKZe9oeV/f4MSno= +golang.org/x/time v0.16.0 h1:vMb6ptszcQMkcwiRTAuNNU50gom6++Q/6gY2hDM6VDE= +golang.org/x/time v0.16.0/go.mod h1:rVKOqvZeKvrDKTQiAHJ7wmwP0RzleSphoEA9RcdLA0s= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= @@ -1204,8 +1202,8 @@ golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= golang.org/x/tools v0.28.0/go.mod h1:dcIOrVd3mfQKTgrDVQHqCPMWy6lnhfhtX3hLXYVLfRw= golang.org/x/tools v0.30.0/go.mod h1:c347cR/OJfw5TI+GfX7RUPNMdDRRbjvYTS0jPyvsVtY= -golang.org/x/tools v0.52.0 h1:ryxg4U63oaUYk7uOLTF37n43f4qgtGvqV4Ioit1BaEs= -golang.org/x/tools v0.52.0/go.mod h1:ItcP5UNaVGG+Yc4eIYmaFLNJ4soEopkx5Y2d4lcEurs= +golang.org/x/tools v0.53.0 h1:T3bIVp3zjHG9/aEiFk6BXxFh5/Vcbk7JA5hRq1cG8IU= +golang.org/x/tools v0.53.0/go.mod h1:vg+Vrb7y5mTTtxZLTdbTK8G745wcaLcsCtgCWgQONCI= golang.org/x/tools/go/expect v0.1.1-deprecated h1:jpBZDwmgPhXsKZC6WhL20P4b/wmnpsEAGHaNy0n/rJM= golang.org/x/tools/go/expect v0.1.1-deprecated/go.mod h1:eihoPOH+FgIqa3FpoTwguz/bVUSGBlGQU67vpBeOrBY= golang.org/x/tools/go/packages/packagestest v0.1.1-deprecated h1:1h2MnaIAIXISqTFKdENegdpAgUXz6NrPEsbIeWaBRvM= @@ -1223,10 +1221,10 @@ google.golang.org/api v0.283.0 h1:0lkp8u0MPwJVHqRL+nJlMAoZVVzbmiXmFHXMOTmSPik= google.golang.org/api v0.283.0/go.mod h1:6Wssta4c5n9qHq5CBhmlai5h/PUa1djdDAIhYEHyvcM= google.golang.org/genproto v0.0.0-20260406210006-6f92a3bedf2d h1:N1Ec54vZnIPd7MnxRiYLW+oY4fDR4BOS/LrssdD9+ek= google.golang.org/genproto v0.0.0-20260406210006-6f92a3bedf2d/go.mod h1:c2hJ1grtnH0xUiEKGDGkjGNTJ1Hy2LrblyKOHF0sqRM= -google.golang.org/genproto/googleapis/api v0.0.0-20260831171406-18b4a7587f8a h1:i3TAXhpKc7TUP1VAPiBBrv45kamjoizCC3rOC0cAbOs= -google.golang.org/genproto/googleapis/api v0.0.0-20260831171406-18b4a7587f8a/go.mod h1:CvYJHpbzPlT0fb/PsgtAamdwru/GVxUsomFdXTpOTI8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260831171406-18b4a7587f8a h1:3Dnd1cDaZlB68lziofO+bJXpjOy8UfRv8Unt+yH8tQ4= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260831171406-18b4a7587f8a/go.mod h1:DjtHYE8FKJLivXcBEjGwndXfIC23G0VpXiXKqG179uA= +google.golang.org/genproto/googleapis/api v0.0.0-20261104224025-d1e00e9f33ab h1:n6IDWZ1RzI/NberLoLLFNrjl1H45uhc4+WYsUf5lPPc= +google.golang.org/genproto/googleapis/api v0.0.0-20261104224025-d1e00e9f33ab/go.mod h1:vHV3wJM9WZyfV7GyB+OQGq5dWVrFwCDxapPK4WlRD88= +google.golang.org/genproto/googleapis/rpc v0.0.0-20261104224025-d1e00e9f33ab h1:8sYjjefPfQ+FZEh1ZwBAqK/NifJVhOxut8nRh3SJzZM= +google.golang.org/genproto/googleapis/rpc v0.0.0-20261104224025-d1e00e9f33ab/go.mod h1:OaIUM3+LpYcK2GXM4FTmhWoIq371Owdr+Cc7/BsYHHc= google.golang.org/grpc v1.85.0 h1:BPBCfuVRQ1qvBhKDOq9uvQllMvO59rKsYhXpp7Dd8vw= google.golang.org/grpc v1.85.0/go.mod h1:0rQrOD58yjal/0EaVbGBANindixsCZNQPDV3VKtaKuQ= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -1300,20 +1298,18 @@ k8s.io/metrics v0.37.1 h1:5lc7WH6ljoxaJ4dK6UHwskVsyH7aNdt/ajo6CLQ1l8Q= k8s.io/metrics v0.37.1/go.mod h1:mpnoLxJYJdBQoxPlgi1Y+gk/bxIuXf5SbS/8jkYzqEo= k8s.io/streaming v0.37.1 h1:TpzVfQeFuVndn2g9mFqxy1UcUYPwDzqjUmwR/IzJCWc= k8s.io/streaming v0.37.1/go.mod h1:APlJR26ZWRcVy5bIEj0QRrKUXROtBHPcxl2NT7EAzPU= -k8s.io/utils v0.0.0-20260707023825-cf1189d6abe3 h1:jVkFFVfXdXP74B/zbO3hM3hpSFD0xvhQ5U686DPurkE= -k8s.io/utils v0.0.0-20260707023825-cf1189d6abe3/go.mod h1:M2s5JB1lIYP3jzZdorPLHXIPJzt9vv2muW5a6L9DtNM= +k8s.io/utils v0.0.0-20261023123148-ca04ba58ecab h1:pjQrNLaF//ytZtWwCAHtW+pqwSKjtWDqzA8+TCX37RI= +k8s.io/utils v0.0.0-20261023123148-ca04ba58ecab/go.mod h1:DdQ0BJxlQtuMlKDqdg7X5IMMQCXIk2b3d1/4M9OhUYo= oras.land/oras-go/v2 v2.6.2 h1:N04RXngAp1LJKTG6ifz3xHPipasEkWr+hFmInja5YKo= oras.land/oras-go/v2 v2.6.2/go.mod h1:PlTtg4JTDJkDe8yVHpM2wz7/YDc00GVas+i4jAW2TZ4= -pgregory.net/rapid v1.2.0 h1:keKAYRcjm+e1F0oAuU5F5+YPAWcyxNNRK2wud503Gnk= -pgregory.net/rapid v1.2.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.36.0 h1:/YpDJ4vReG7ZmzSpBGxduXgywWkJU9zHubgJG03MT+Y= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.36.0/go.mod h1:tJo1aepTXyR+8Xs3sUsGBDk4Ub2AM5dPAPKJx0mpm5c= sigs.k8s.io/controller-runtime v0.24.1 h1:miPEwrmirImAvgME1L9qebGHrOnGJoVmVdtOU9fRfo4= sigs.k8s.io/controller-runtime v0.24.1/go.mod h1:vFkfY5fGt5xAC/sKb8IBFKgWPNKG9OUG29dR8Y2wImw= sigs.k8s.io/controller-tools v0.20.0 h1:VWZF71pwSQ2lZZCt7hFGJsOfDc5dVG28/IysjjMWXL8= sigs.k8s.io/controller-tools v0.20.0/go.mod h1:b4qPmjGU3iZwqn34alUU5tILhNa9+VXK+J3QV0fT/uU= -sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 h1:IpInykpT6ceI+QxKBbEflcR5EXP7sU1kvOlxwZh5txg= -sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg= +sigs.k8s.io/json v0.0.0-20260909141634-11ed52e25bc5 h1:k9jo7ED/fsfOcz3L1P20P5tjTNtsdQNwMOG2aKzHrl8= +sigs.k8s.io/json v0.0.0-20260909141634-11ed52e25bc5/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg= sigs.k8s.io/kind v0.33.0 h1:AjvDv3vOygb/VKLVQW87lfktIBzkxR8Ump9DjxC8+Lk= sigs.k8s.io/kind v0.33.0/go.mod h1:FSqriGaoTPruiXWfRnUXNykF8r2t+fHtK0P0m1AbGF8= sigs.k8s.io/kustomize/api v0.21.1 h1:lzqbzvz2CSvsjIUZUBNFKtIMsEw7hVLJp0JeSIVmuJs= diff --git a/nix/vendor-hashes.nix b/nix/vendor-hashes.nix index 4d111a89..103b4031 100644 --- a/nix/vendor-hashes.nix +++ b/nix/vendor-hashes.nix @@ -12,5 +12,5 @@ # hand.) { # Root module: github.com/crossplane/cli/v2 - root = "sha256-ZVlGfgCHlfAJumwybqvCilM2iyVRMUMEg5j1V8v3P3g="; + root = "sha256-1GHHmVjxdK+SfeIip3e+CxQPgQjUyN4qhddmFv6aHZQ="; } From dc37b03e465f2ab279a4d4b30328b124aa446dfe Mon Sep 17 00:00:00 2001 From: Adam Wolfe Gordon Date: Fri, 20 Nov 2026 09:55:40 -0600 Subject: [PATCH 2/3] Fix lint issues Run `nix run .#lint` to clear up lint issues triggered by our recent go upgrade. Signed-off-by: Adam Wolfe Gordon --- apis/dev/v1alpha1/validate_test.go | 102 +++-------- cmd/crossplane/composition/generate.go | 10 +- cmd/crossplane/dependency/dependency_test.go | 4 +- cmd/crossplane/function/generate_test.go | 14 +- cmd/crossplane/project/build_test.go | 2 +- cmd/crossplane/project/simulate_test.go | 172 ++++++++++-------- cmd/crossplane/render/contextfn/wire.go | 10 +- cmd/crossplane/render/op/load.go | 4 +- cmd/crossplane/render/op/load_test.go | 10 +- cmd/crossplane/top/top_test.go | 50 ++--- cmd/crossplane/validate/validate_test.go | 64 +++---- .../version/fetch_integration_test.go | 4 +- cmd/crossplane/xpkg/get_crds_test.go | 14 +- cmd/crossplane/xpkg/install.go | 12 +- .../xpkg/install_integration_test.go | 6 +- cmd/crossplane/xpkg/push.go | 14 +- cmd/crossplane/xrd/convert_test.go | 2 +- cmd/crossplane/xrd/generate.go | 20 +- cmd/crossplane/xrd/generate_test.go | 90 +++------ internal/containerruntime/run_test.go | 2 +- internal/dependency/manager_test.go | 20 +- internal/diff/client/client_test.go | 4 +- .../crossplane/composition_client_test.go | 32 ++-- .../composition_revision_client_test.go | 70 +++---- .../client/crossplane/function_client_test.go | 40 ++-- internal/diff/diffprocessor/comp_processor.go | 12 +- .../diff/diffprocessor/comp_processor_test.go | 8 +- .../diff/diffprocessor/diff_processor_test.go | 106 +++++------ .../diffprocessor/function_provider_test.go | 40 ++-- .../project_function_provider_test.go | 12 +- .../diff/diffprocessor/render_engine_test.go | 4 +- internal/diff/diffprocessor/render_version.go | 6 +- .../diff/renderer/comp_diff_renderer_test.go | 70 +++---- .../diff/renderer/dry_run_warnings_test.go | 6 +- internal/diff/testutils/mock_builder.go | 32 +--- internal/kube/restmapper_test.go | 6 +- internal/project/build.go | 12 +- internal/project/build_test.go | 20 +- internal/project/controlplane/controlplane.go | 32 +--- internal/project/image.go | 14 +- internal/project/install.go | 10 +- internal/project/install_test.go | 14 +- .../project/projectfile/projectfile_test.go | 10 +- internal/project/render.go | 8 +- internal/schemas/generator/go.go | 12 +- internal/schemas/generator/json_test.go | 18 +- internal/schemas/generator/rust_test.go | 20 +- internal/simulate/report_test.go | 4 +- internal/simulate/result_test.go | 75 ++++---- internal/simulate/run_test.go | 16 +- .../simulate/simtest/structured_assertions.go | 4 +- .../simtest/structured_assertions_test.go | 32 ++-- internal/simulate/xrplan_test.go | 6 +- internal/testutils/integration/fixtures.go | 8 +- internal/xpkg/configuration.go | 4 +- internal/xpkg/configuration_test.go | 16 +- pkg/render/load_test.go | 88 ++++----- pkg/render/output_test.go | 6 +- pkg/render/render_test.go | 10 +- pkg/render/session_test.go | 6 +- pkg/validate/validate_test.go | 24 +-- 61 files changed, 639 insertions(+), 904 deletions(-) diff --git a/apis/dev/v1alpha1/validate_test.go b/apis/dev/v1alpha1/validate_test.go index d7457c56..19464163 100644 --- a/apis/dev/v1alpha1/validate_test.go +++ b/apis/dev/v1alpha1/validate_test.go @@ -35,9 +35,7 @@ func TestValidate(t *testing.T) { }{ "MinimalValid": { input: &Project{ - ObjectMeta: metav1.ObjectMeta{ - Name: "my-project", - }, + Name: "my-project", Spec: ProjectSpec{ Repository: "xpkg.upbound.io/acmeco/my-project", }, @@ -45,9 +43,7 @@ func TestValidate(t *testing.T) { }, "MaximalValid": { input: &Project{ - ObjectMeta: metav1.ObjectMeta{ - Name: "my-project", - }, + Name: "my-project", Spec: ProjectSpec{ Repository: "xpkg.upbound.io/acmeco/my-project", ProjectPackageMetadata: ProjectPackageMetadata{ @@ -93,9 +89,7 @@ func TestValidate(t *testing.T) { }, "MissingRepository": { input: &Project{ - ObjectMeta: metav1.ObjectMeta{ - Name: "my-project", - }, + Name: "my-project", Spec: ProjectSpec{}, }, expectedErrors: []string{ @@ -104,9 +98,7 @@ func TestValidate(t *testing.T) { }, "AbsolutePaths": { input: &Project{ - ObjectMeta: metav1.ObjectMeta{ - Name: "my-project", - }, + Name: "my-project", Spec: ProjectSpec{ Repository: "xpkg.upbound.io/acmeco/my-project", Paths: &ProjectPaths{ @@ -128,9 +120,7 @@ func TestValidate(t *testing.T) { }, "EmptyArchitectures": { input: &Project{ - ObjectMeta: metav1.ObjectMeta{ - Name: "my-project", - }, + Name: "my-project", Spec: ProjectSpec{ Repository: "xpkg.upbound.io/acmeco/my-project", Architectures: []string{}, @@ -142,9 +132,7 @@ func TestValidate(t *testing.T) { }, "ValidSchemaLanguages": { input: &Project{ - ObjectMeta: metav1.ObjectMeta{ - Name: "my-project", - }, + Name: "my-project", Spec: ProjectSpec{ Repository: "xpkg.upbound.io/acmeco/my-project", Schemas: &ProjectSchemas{ @@ -155,9 +143,7 @@ func TestValidate(t *testing.T) { }, "EmptySchemaLanguages": { input: &Project{ - ObjectMeta: metav1.ObjectMeta{ - Name: "my-project", - }, + Name: "my-project", Spec: ProjectSpec{ Repository: "xpkg.upbound.io/acmeco/my-project", Schemas: &ProjectSchemas{ @@ -171,9 +157,7 @@ func TestValidate(t *testing.T) { }, "UnsupportedSchemaLanguage": { input: &Project{ - ObjectMeta: metav1.ObjectMeta{ - Name: "my-project", - }, + Name: "my-project", Spec: ProjectSpec{ Repository: "xpkg.upbound.io/acmeco/my-project", Schemas: &ProjectSchemas{ @@ -187,9 +171,7 @@ func TestValidate(t *testing.T) { }, "ValidAPIDependency": { input: &Project{ - ObjectMeta: metav1.ObjectMeta{ - Name: "my-project", - }, + Name: "my-project", Spec: ProjectSpec{ Repository: "xpkg.upbound.io/acmeco/my-project", Dependencies: []Dependency{ @@ -207,9 +189,7 @@ func TestValidate(t *testing.T) { }, "InvalidAPIDependencyNoType": { input: &Project{ - ObjectMeta: metav1.ObjectMeta{ - Name: "my-project", - }, + Name: "my-project", Spec: ProjectSpec{ Repository: "xpkg.upbound.io/acmeco/my-project", Dependencies: []Dependency{ @@ -227,9 +207,7 @@ func TestValidate(t *testing.T) { }, "InvalidAPIDependencyNoSource": { input: &Project{ - ObjectMeta: metav1.ObjectMeta{ - Name: "my-project", - }, + Name: "my-project", Spec: ProjectSpec{ Repository: "xpkg.upbound.io/acmeco/my-project", Dependencies: []Dependency{ @@ -245,9 +223,7 @@ func TestValidate(t *testing.T) { }, "InvalidAPIDependencyMultipleSources": { input: &Project{ - ObjectMeta: metav1.ObjectMeta{ - Name: "my-project", - }, + Name: "my-project", Spec: ProjectSpec{ Repository: "xpkg.upbound.io/acmeco/my-project", Dependencies: []Dependency{ @@ -269,9 +245,7 @@ func TestValidate(t *testing.T) { }, "InvalidAPIDependencyGitEmptyRepository": { input: &Project{ - ObjectMeta: metav1.ObjectMeta{ - Name: "my-project", - }, + Name: "my-project", Spec: ProjectSpec{ Repository: "xpkg.upbound.io/acmeco/my-project", Dependencies: []Dependency{ @@ -290,9 +264,7 @@ func TestValidate(t *testing.T) { }, "InvalidAPIDependencyHTTPEmptyURL": { input: &Project{ - ObjectMeta: metav1.ObjectMeta{ - Name: "my-project", - }, + Name: "my-project", Spec: ProjectSpec{ Repository: "xpkg.upbound.io/acmeco/my-project", Dependencies: []Dependency{ @@ -311,9 +283,7 @@ func TestValidate(t *testing.T) { }, "InvalidAPIDependencyK8sEmptyVersion": { input: &Project{ - ObjectMeta: metav1.ObjectMeta{ - Name: "my-project", - }, + Name: "my-project", Spec: ProjectSpec{ Repository: "xpkg.upbound.io/acmeco/my-project", Dependencies: []Dependency{ @@ -332,9 +302,7 @@ func TestValidate(t *testing.T) { }, "ValidDirectoryFunction": { input: &Project{ - ObjectMeta: metav1.ObjectMeta{ - Name: "my-project", - }, + Name: "my-project", Spec: ProjectSpec{ Repository: "xpkg.upbound.io/acmeco/my-project", Functions: []Function{{ @@ -346,9 +314,7 @@ func TestValidate(t *testing.T) { }, "ValidTarballFunction": { input: &Project{ - ObjectMeta: metav1.ObjectMeta{ - Name: "my-project", - }, + Name: "my-project", Spec: ProjectSpec{ Repository: "xpkg.upbound.io/acmeco/my-project", Functions: []Function{{ @@ -360,7 +326,7 @@ func TestValidate(t *testing.T) { }, "FunctionMissingSource": { input: &Project{ - ObjectMeta: metav1.ObjectMeta{Name: "my-project"}, + Name: "my-project", Spec: ProjectSpec{ Repository: "xpkg.upbound.io/acmeco/my-project", Functions: []Function{{ @@ -374,7 +340,7 @@ func TestValidate(t *testing.T) { }, "FunctionUnknownSource": { input: &Project{ - ObjectMeta: metav1.ObjectMeta{Name: "my-project"}, + Name: "my-project", Spec: ProjectSpec{ Repository: "xpkg.upbound.io/acmeco/my-project", Functions: []Function{{ @@ -389,7 +355,7 @@ func TestValidate(t *testing.T) { }, "FunctionDirectorySourceMissingDirectory": { input: &Project{ - ObjectMeta: metav1.ObjectMeta{Name: "my-project"}, + Name: "my-project", Spec: ProjectSpec{ Repository: "xpkg.upbound.io/acmeco/my-project", Functions: []Function{{ @@ -404,7 +370,7 @@ func TestValidate(t *testing.T) { }, "FunctionTarballSourceMissingTarball": { input: &Project{ - ObjectMeta: metav1.ObjectMeta{Name: "my-project"}, + Name: "my-project", Spec: ProjectSpec{ Repository: "xpkg.upbound.io/acmeco/my-project", Functions: []Function{{ @@ -419,7 +385,7 @@ func TestValidate(t *testing.T) { }, "FunctionMultipleSources": { input: &Project{ - ObjectMeta: metav1.ObjectMeta{Name: "my-project"}, + Name: "my-project", Spec: ProjectSpec{ Repository: "xpkg.upbound.io/acmeco/my-project", Functions: []Function{{ @@ -435,7 +401,7 @@ func TestValidate(t *testing.T) { }, "FunctionDirectoryEmptyName": { input: &Project{ - ObjectMeta: metav1.ObjectMeta{Name: "my-project"}, + Name: "my-project", Spec: ProjectSpec{ Repository: "xpkg.upbound.io/acmeco/my-project", Functions: []Function{{ @@ -450,7 +416,7 @@ func TestValidate(t *testing.T) { }, "FunctionTarballEmptyPathPrefix": { input: &Project{ - ObjectMeta: metav1.ObjectMeta{Name: "my-project"}, + Name: "my-project", Spec: ProjectSpec{ Repository: "xpkg.upbound.io/acmeco/my-project", Functions: []Function{{ @@ -465,7 +431,7 @@ func TestValidate(t *testing.T) { }, "FunctionTarballAbsolutePathPrefix": { input: &Project{ - ObjectMeta: metav1.ObjectMeta{Name: "my-project"}, + Name: "my-project", Spec: ProjectSpec{ Repository: "xpkg.upbound.io/acmeco/my-project", Functions: []Function{{ @@ -480,7 +446,7 @@ func TestValidate(t *testing.T) { }, "FunctionDuplicateName": { input: &Project{ - ObjectMeta: metav1.ObjectMeta{Name: "my-project"}, + Name: "my-project", Spec: ProjectSpec{ Repository: "xpkg.upbound.io/acmeco/my-project", Functions: []Function{ @@ -524,9 +490,7 @@ func TestDefault(t *testing.T) { }{ "FullySpecified": { input: &Project{ - ObjectMeta: metav1.ObjectMeta{ - Name: "my-project", - }, + Name: "my-project", Spec: ProjectSpec{ Repository: "xpkg.upbound.io/acmeco/my-project", ProjectPackageMetadata: ProjectPackageMetadata{ @@ -559,9 +523,7 @@ func TestDefault(t *testing.T) { }, }, want: &Project{ - ObjectMeta: metav1.ObjectMeta{ - Name: "my-project", - }, + Name: "my-project", Spec: ProjectSpec{ Repository: "xpkg.upbound.io/acmeco/my-project", ProjectPackageMetadata: ProjectPackageMetadata{ @@ -597,17 +559,13 @@ func TestDefault(t *testing.T) { }, "MinimalValid": { input: &Project{ - ObjectMeta: metav1.ObjectMeta{ - Name: "my-project", - }, + Name: "my-project", Spec: ProjectSpec{ Repository: "xpkg.upbound.io/acmeco/my-project", }, }, want: &Project{ - ObjectMeta: metav1.ObjectMeta{ - Name: "my-project", - }, + Name: "my-project", Spec: ProjectSpec{ Repository: "xpkg.upbound.io/acmeco/my-project", Paths: &ProjectPaths{ diff --git a/cmd/crossplane/composition/generate.go b/cmd/crossplane/composition/generate.go index b593b10e..93d3c0a3 100644 --- a/cmd/crossplane/composition/generate.go +++ b/cmd/crossplane/composition/generate.go @@ -183,13 +183,9 @@ func (c *generateCmd) newComposition() (*apiextv1.Composition, string, error) { } comp := &apiextv1.Composition{ - TypeMeta: metav1.TypeMeta{ - APIVersion: apiextv1.CompositionGroupVersionKind.GroupVersion().String(), - Kind: apiextv1.CompositionGroupVersionKind.Kind, - }, - ObjectMeta: metav1.ObjectMeta{ - Name: name, - }, + APIVersion: apiextv1.CompositionGroupVersionKind.GroupVersion().String(), + Kind: apiextv1.CompositionGroupVersionKind.Kind, + Name: name, Spec: apiextv1.CompositionSpec{ CompositeTypeRef: apiextv1.TypeReference{ APIVersion: fmt.Sprintf("%s/%s", group, version), diff --git a/cmd/crossplane/dependency/dependency_test.go b/cmd/crossplane/dependency/dependency_test.go index a5c4ecb6..8cfbefff 100644 --- a/cmd/crossplane/dependency/dependency_test.go +++ b/cmd/crossplane/dependency/dependency_test.go @@ -38,14 +38,14 @@ import ( func TestAddGitAuth(t *testing.T) { testDependencyGitAuth(t, func(serverURL, projectFile, cacheDir, token string) error { - c := &AddCmd{Package: serverURL + "/repo.git", GitRef: "main", ProjectFile: projectFile, CacheDir: cacheDir, GitFlags: common.GitFlags{GitToken: token, GitUsername: "test-user"}} + c := &AddCmd{Package: serverURL + "/repo.git", GitRef: "main", ProjectFile: projectFile, CacheDir: cacheDir, GitToken: token, GitUsername: "test-user"} return c.Run(logging.NewNopLogger(), terminal.NewSpinnerPrinter(io.Discard, false), &config.Config{}) }) } func TestUpdateCacheGitAuth(t *testing.T) { testDependencyGitAuth(t, func(_, projectFile, cacheDir, token string) error { - c := &UpdateCacheCmd{ProjectFile: projectFile, CacheDir: cacheDir, GitFlags: common.GitFlags{GitToken: token, GitUsername: "test-user"}} + c := &UpdateCacheCmd{ProjectFile: projectFile, CacheDir: cacheDir, GitToken: token, GitUsername: "test-user"} return c.Run(logging.NewNopLogger(), terminal.NewSpinnerPrinter(io.Discard, false), &config.Config{}) }) } diff --git a/cmd/crossplane/function/generate_test.go b/cmd/crossplane/function/generate_test.go index 494673e8..7cd3e0f8 100644 --- a/cmd/crossplane/function/generate_test.go +++ b/cmd/crossplane/function/generate_test.go @@ -618,10 +618,8 @@ func TestAddCompositionStep(t *testing.T) { for name, tc := range cases { t.Run(name, func(t *testing.T) { comp := &apiextv1.Composition{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "apiextensions.crossplane.io/v1", - Kind: "Composition", - }, + APIVersion: "apiextensions.crossplane.io/v1", + Kind: "Composition", Spec: apiextv1.CompositionSpec{ Pipeline: tc.start, }, @@ -652,11 +650,9 @@ func TestAddStepToComposition(t *testing.T) { }{ "PrependsAndPersists": { comp: &apiextv1.Composition{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "apiextensions.crossplane.io/v1", - Kind: "Composition", - }, - ObjectMeta: metav1.ObjectMeta{Name: "test-comp"}, + APIVersion: "apiextensions.crossplane.io/v1", + Kind: "Composition", + Name: "test-comp", Spec: apiextv1.CompositionSpec{ CompositeTypeRef: apiextv1.TypeReference{ APIVersion: "example.org/v1", diff --git a/cmd/crossplane/project/build_test.go b/cmd/crossplane/project/build_test.go index 66f63268..53aa4bae 100644 --- a/cmd/crossplane/project/build_test.go +++ b/cmd/crossplane/project/build_test.go @@ -75,7 +75,7 @@ spec: sp := terminal.NewSpinnerPrinter(io.Discard, false) cfg := &config.Config{} - c := &BuildCmd{ProjectFile: projectFile, CacheDir: filepath.Join(dir, "cache"), GitFlags: common.GitFlags{GitToken: token, GitUsername: "test-user"}, MaxConcurrency: 1} + c := &BuildCmd{ProjectFile: projectFile, CacheDir: filepath.Join(dir, "cache"), GitToken: token, GitUsername: "test-user", MaxConcurrency: 1} if err := c.AfterApply(); err != nil { t.Fatal(err) } diff --git a/cmd/crossplane/project/simulate_test.go b/cmd/crossplane/project/simulate_test.go index 1eef5867..1d7ff03c 100644 --- a/cmd/crossplane/project/simulate_test.go +++ b/cmd/crossplane/project/simulate_test.go @@ -71,13 +71,14 @@ func TestSimulateFlags(t *testing.T) { }{ "Defaults": { reason: "With no flags the defaults should apply.", - want: want{cmd: &SimulateCmd{MaxConcurrency: 8, ProjectFile: "crossplane-project.yaml", Flags: simulate.Flags{ + want: want{cmd: &SimulateCmd{ + MaxConcurrency: 8, ProjectFile: "crossplane-project.yaml", MaxIterations: dp.DefaultMaxRenderIterations, Timeout: 2 * time.Minute, Output: "plan", MaxNestedDepth: 10, DryRunOn: "all", - }}}, + }}, }, "AllFlags": { reason: "Every flag should land on its field.", @@ -87,15 +88,16 @@ func TestSimulateFlags(t *testing.T) { "--max-concurrency", "2", "-o", "json", "--crossplane-version", "v2.3.4", "--as", "jane", "--as-group", "admins", }, - want: want{cmd: &SimulateCmd{MaxConcurrency: 2, ProjectFile: "p.yaml", Flags: simulate.Flags{ - Context: "staging", - MaxIterations: 3, - Timeout: 2 * time.Minute, - Output: "json", - EngineFlags: render.EngineFlags{CrossplaneVersion: "v2.3.4"}, - MaxNestedDepth: 10, - DryRunOn: "all", - }, CompositionFlags: simulate.CompositionFlags{Namespace: "team-a", Name: []string{"db"}, IncludePinned: true}}}, + want: want{cmd: &SimulateCmd{ + MaxConcurrency: 2, ProjectFile: "p.yaml", + Context: "staging", + MaxIterations: 3, + Timeout: 2 * time.Minute, + Output: "json", + CrossplaneVersion: "v2.3.4", + MaxNestedDepth: 10, + DryRunOn: "all", Namespace: "team-a", Name: []string{"db"}, IncludePinned: true, + }}, }, "ParityFlags": { reason: "The diff flags should land on their fields.", @@ -104,7 +106,8 @@ func TestSimulateFlags(t *testing.T) { "--eventual-state", "--max-recv-message-size", "16", "--minimize-composition", "--analyze-on", "always", "--dry-run-on", "existing", }, - want: want{cmd: &SimulateCmd{MaxConcurrency: 8, ProjectFile: "crossplane-project.yaml", Flags: simulate.Flags{ + want: want{cmd: &SimulateCmd{ + MaxConcurrency: 8, ProjectFile: "crossplane-project.yaml", MaxIterations: dp.DefaultMaxRenderIterations, Timeout: 2 * time.Minute, Output: "plan", @@ -114,21 +117,22 @@ func TestSimulateFlags(t *testing.T) { IgnorePaths: []string{"a.b", "c.d"}, EventualState: true, MaxRecvMessageSize: 16, - DryRunOn: "existing", - }, CompositionFlags: simulate.CompositionFlags{MinimizeComposition: true, AnalyzeOn: "always"}}}, + DryRunOn: "existing", MinimizeComposition: true, AnalyzeOn: "always", + }}, }, "FunctionCredentials": { reason: "--function-credentials should land on its field; Run loads the Secrets.", args: []string{"--function-credentials", creds}, want: want{ - cmd: &SimulateCmd{MaxConcurrency: 8, ProjectFile: "crossplane-project.yaml", Flags: simulate.Flags{ + cmd: &SimulateCmd{ + MaxConcurrency: 8, ProjectFile: "crossplane-project.yaml", MaxIterations: dp.DefaultMaxRenderIterations, Timeout: 2 * time.Minute, Output: "plan", MaxNestedDepth: 10, DryRunOn: "all", FunctionCredentials: creds, - }}, + }, }, }, "UnknownDryRunOn": { @@ -144,7 +148,8 @@ func TestSimulateFlags(t *testing.T) { "PlanFlags": { reason: "The provider plan flags should land on their fields.", args: []string{"--providers", dir, "--image-configs", creds, "--session-id", "s1"}, - want: want{cmd: &SimulateCmd{MaxConcurrency: 8, ProjectFile: "crossplane-project.yaml", Flags: simulate.Flags{ + want: want{cmd: &SimulateCmd{ + MaxConcurrency: 8, ProjectFile: "crossplane-project.yaml", MaxIterations: dp.DefaultMaxRenderIterations, Timeout: 2 * time.Minute, Output: "plan", @@ -152,86 +157,93 @@ func TestSimulateFlags(t *testing.T) { DryRunOn: "all", Providers: dir, ImageConfigs: creds, - EngineFlags: render.EngineFlags{SessionID: "s1"}, - }}}, + SessionID: "s1", + }}, }, "RenderEngineFlags": { reason: "The render engine flags should land on the embedded EngineFlags.", args: []string{"--crossplane-binary", creds, "--session-id", "s1"}, - want: want{cmd: &SimulateCmd{MaxConcurrency: 8, ProjectFile: "crossplane-project.yaml", Flags: simulate.Flags{ - MaxIterations: dp.DefaultMaxRenderIterations, - Timeout: 2 * time.Minute, - Output: "plan", - MaxNestedDepth: 10, - DryRunOn: "all", - EngineFlags: render.EngineFlags{CrossplaneBinary: creds, SessionID: "s1"}, - }}}, + want: want{cmd: &SimulateCmd{ + MaxConcurrency: 8, ProjectFile: "crossplane-project.yaml", + MaxIterations: dp.DefaultMaxRenderIterations, + Timeout: 2 * time.Minute, + Output: "plan", + MaxNestedDepth: 10, + DryRunOn: "all", + CrossplaneBinary: creds, SessionID: "s1", + }}, }, "RenderDockerNetwork": { reason: "--crossplane-docker-network should land on the embedded EngineFlags.", args: []string{"--crossplane-docker-network", "ci"}, - want: want{cmd: &SimulateCmd{MaxConcurrency: 8, ProjectFile: "crossplane-project.yaml", Flags: simulate.Flags{ - MaxIterations: dp.DefaultMaxRenderIterations, - Timeout: 2 * time.Minute, - Output: "plan", - MaxNestedDepth: 10, - DryRunOn: "all", - EngineFlags: render.EngineFlags{CrossplaneDockerNetwork: "ci"}, - }}}, + want: want{cmd: &SimulateCmd{ + MaxConcurrency: 8, ProjectFile: "crossplane-project.yaml", + MaxIterations: dp.DefaultMaxRenderIterations, + Timeout: 2 * time.Minute, + Output: "plan", + MaxNestedDepth: 10, + DryRunOn: "all", + CrossplaneDockerNetwork: "ci", + }}, }, "RenderDockerNetworkEnv": { reason: "CROSSPLANE_DOCKER_NETWORK should land on the embedded EngineFlags.", env: map[string]string{"CROSSPLANE_DOCKER_NETWORK": "env-net"}, - want: want{cmd: &SimulateCmd{MaxConcurrency: 8, ProjectFile: "crossplane-project.yaml", Flags: simulate.Flags{ - MaxIterations: dp.DefaultMaxRenderIterations, - Timeout: 2 * time.Minute, - Output: "plan", - MaxNestedDepth: 10, - DryRunOn: "all", - EngineFlags: render.EngineFlags{CrossplaneDockerNetwork: "env-net"}, - }}}, + want: want{cmd: &SimulateCmd{ + MaxConcurrency: 8, ProjectFile: "crossplane-project.yaml", + MaxIterations: dp.DefaultMaxRenderIterations, + Timeout: 2 * time.Minute, + Output: "plan", + MaxNestedDepth: 10, + DryRunOn: "all", + CrossplaneDockerNetwork: "env-net", + }}, }, "RenderDockerNetworkFlagOverEnv": { reason: "--crossplane-docker-network should win over CROSSPLANE_DOCKER_NETWORK.", env: map[string]string{"CROSSPLANE_DOCKER_NETWORK": "env-net"}, args: []string{"--crossplane-docker-network", "ci"}, - want: want{cmd: &SimulateCmd{MaxConcurrency: 8, ProjectFile: "crossplane-project.yaml", Flags: simulate.Flags{ - MaxIterations: dp.DefaultMaxRenderIterations, - Timeout: 2 * time.Minute, - Output: "plan", - MaxNestedDepth: 10, - DryRunOn: "all", - EngineFlags: render.EngineFlags{CrossplaneDockerNetwork: "ci"}, - }}}, + want: want{cmd: &SimulateCmd{ + MaxConcurrency: 8, ProjectFile: "crossplane-project.yaml", + MaxIterations: dp.DefaultMaxRenderIterations, + Timeout: 2 * time.Minute, + Output: "plan", + MaxNestedDepth: 10, + DryRunOn: "all", + CrossplaneDockerNetwork: "ci", + }}, }, "RenderBinaryWithNetwork": { reason: "A local render binary ignores a Docker network rather than rejecting it.", args: []string{"--crossplane-binary", creds, "--crossplane-docker-network", "ci"}, - want: want{cmd: &SimulateCmd{MaxConcurrency: 8, ProjectFile: "crossplane-project.yaml", Flags: simulate.Flags{ - MaxIterations: dp.DefaultMaxRenderIterations, - Timeout: 2 * time.Minute, - Output: "plan", - MaxNestedDepth: 10, - DryRunOn: "all", - EngineFlags: render.EngineFlags{CrossplaneBinary: creds, CrossplaneDockerNetwork: "ci"}, - }}}, + want: want{cmd: &SimulateCmd{ + MaxConcurrency: 8, ProjectFile: "crossplane-project.yaml", + MaxIterations: dp.DefaultMaxRenderIterations, + Timeout: 2 * time.Minute, + Output: "plan", + MaxNestedDepth: 10, + DryRunOn: "all", + CrossplaneBinary: creds, CrossplaneDockerNetwork: "ci", + }}, }, "SkipPlan": { reason: "--skip-plan alone should be accepted.", args: []string{"--skip-plan"}, - want: want{cmd: &SimulateCmd{MaxConcurrency: 8, ProjectFile: "crossplane-project.yaml", Flags: simulate.Flags{ + want: want{cmd: &SimulateCmd{ + MaxConcurrency: 8, ProjectFile: "crossplane-project.yaml", MaxIterations: dp.DefaultMaxRenderIterations, Timeout: 2 * time.Minute, Output: "plan", MaxNestedDepth: 10, DryRunOn: "all", SkipPlan: true, - }}}, + }}, }, "SkipPlanWithProviders": { reason: "--providers does nothing with --skip-plan, so Run warns rather than Validate rejecting it.", args: []string{"--skip-plan", "--providers", dir}, - want: want{cmd: &SimulateCmd{MaxConcurrency: 8, ProjectFile: "crossplane-project.yaml", Flags: simulate.Flags{ + want: want{cmd: &SimulateCmd{ + MaxConcurrency: 8, ProjectFile: "crossplane-project.yaml", MaxIterations: dp.DefaultMaxRenderIterations, Timeout: 2 * time.Minute, Output: "plan", @@ -239,12 +251,13 @@ func TestSimulateFlags(t *testing.T) { DryRunOn: "all", SkipPlan: true, Providers: dir, - }}}, + }}, }, "SkipPlanWithImageConfigs": { reason: "--image-configs also rewrites function images, so it applies with --skip-plan.", args: []string{"--skip-plan", "--image-configs", creds}, - want: want{cmd: &SimulateCmd{MaxConcurrency: 8, ProjectFile: "crossplane-project.yaml", Flags: simulate.Flags{ + want: want{cmd: &SimulateCmd{ + MaxConcurrency: 8, ProjectFile: "crossplane-project.yaml", MaxIterations: dp.DefaultMaxRenderIterations, Timeout: 2 * time.Minute, Output: "plan", @@ -252,20 +265,21 @@ func TestSimulateFlags(t *testing.T) { DryRunOn: "all", SkipPlan: true, ImageConfigs: creds, - }}}, + }}, }, "SkipPlanWithSessionID": { reason: "--session-id does nothing with --skip-plan, so Run warns rather than Validate rejecting it.", args: []string{"--skip-plan", "--session-id", "s1"}, - want: want{cmd: &SimulateCmd{MaxConcurrency: 8, ProjectFile: "crossplane-project.yaml", Flags: simulate.Flags{ + want: want{cmd: &SimulateCmd{ + MaxConcurrency: 8, ProjectFile: "crossplane-project.yaml", MaxIterations: dp.DefaultMaxRenderIterations, Timeout: 2 * time.Minute, Output: "plan", MaxNestedDepth: 10, DryRunOn: "all", SkipPlan: true, - EngineFlags: render.EngineFlags{SessionID: "s1"}, - }}}, + SessionID: "s1", + }}, }, "UnknownOutput": { reason: "Output formats other than plan, diff, json and yaml should be rejected.", @@ -275,13 +289,14 @@ func TestSimulateFlags(t *testing.T) { "ZeroConcurrency": { reason: "Zero build slots should be accepted; the builder runs one build at a time.", args: []string{"--max-concurrency", "0"}, - want: want{cmd: &SimulateCmd{ProjectFile: "crossplane-project.yaml", Flags: simulate.Flags{ + want: want{cmd: &SimulateCmd{ + ProjectFile: "crossplane-project.yaml", MaxIterations: dp.DefaultMaxRenderIterations, Timeout: 2 * time.Minute, Output: "plan", MaxNestedDepth: 10, DryRunOn: "all", - }}}, + }}, }, "EmptyName": { reason: "An empty --name should fail at parse time.", @@ -326,14 +341,15 @@ func TestSimulateFlags(t *testing.T) { "RenderImageUncomparable": { reason: "A render image with no comparable version should be accepted.", args: []string{"--crossplane-image", "example.com/crossplane:stable"}, - want: want{cmd: &SimulateCmd{MaxConcurrency: 8, ProjectFile: "crossplane-project.yaml", Flags: simulate.Flags{ - MaxIterations: dp.DefaultMaxRenderIterations, - Timeout: 2 * time.Minute, - Output: "plan", - MaxNestedDepth: 10, - DryRunOn: "all", - EngineFlags: render.EngineFlags{CrossplaneImage: "example.com/crossplane:stable"}, - }}}, + want: want{cmd: &SimulateCmd{ + MaxConcurrency: 8, ProjectFile: "crossplane-project.yaml", + MaxIterations: dp.DefaultMaxRenderIterations, + Timeout: 2 * time.Minute, + Output: "plan", + MaxNestedDepth: 10, + DryRunOn: "all", + CrossplaneImage: "example.com/crossplane:stable", + }}, }, "RenderBackendsExclusive": { reason: "--crossplane-version and --crossplane-image should be mutually exclusive.", diff --git a/cmd/crossplane/render/contextfn/wire.go b/cmd/crossplane/render/contextfn/wire.go index 2fb5601e..5131b92a 100644 --- a/cmd/crossplane/render/contextfn/wire.go +++ b/cmd/crossplane/render/contextfn/wire.go @@ -37,12 +37,10 @@ const ( // known by name. func (h *Handle) Function() pkgv1.Function { return pkgv1.Function{ - ObjectMeta: metav1.ObjectMeta{ - Name: FunctionName, - Annotations: map[string]string{ - annotationKeyRuntime: annotationValueRuntimeDevelopment, - annotationKeyRuntimeDevelopmentTarget: h.target, - }, + Name: FunctionName, + Annotations: map[string]string{ + annotationKeyRuntime: annotationValueRuntimeDevelopment, + annotationKeyRuntimeDevelopmentTarget: h.target, }, } } diff --git a/cmd/crossplane/render/op/load.go b/cmd/crossplane/render/op/load.go index 680a801c..a0b2d8bd 100644 --- a/cmd/crossplane/render/op/load.go +++ b/cmd/crossplane/render/op/load.go @@ -61,7 +61,7 @@ func LoadOperation(fs afero.Fs, path string) (*opsv1alpha1.Operation, error) { // controller does. The real controller always overwrites the name with // a generated one; we use the parent's name for simplicity. op := &opsv1alpha1.Operation{ - TypeMeta: metav1.TypeMeta{APIVersion: meta.APIVersion, Kind: opsv1alpha1.OperationKind}, + APIVersion: meta.APIVersion, Kind: opsv1alpha1.OperationKind, ObjectMeta: cop.Spec.OperationTemplate.ObjectMeta, Spec: cop.Spec.OperationTemplate.Spec, } @@ -77,7 +77,7 @@ func LoadOperation(fs afero.Fs, path string) (*opsv1alpha1.Operation, error) { // controller does. The real controller always overwrites the name with // a generated one; we use the parent's name for simplicity. op := &opsv1alpha1.Operation{ - TypeMeta: metav1.TypeMeta{APIVersion: meta.APIVersion, Kind: opsv1alpha1.OperationKind}, + APIVersion: meta.APIVersion, Kind: opsv1alpha1.OperationKind, ObjectMeta: wop.Spec.OperationTemplate.ObjectMeta, Spec: *wop.Spec.OperationTemplate.Spec.DeepCopy(), } diff --git a/cmd/crossplane/render/op/load_test.go b/cmd/crossplane/render/op/load_test.go index 833c5942..436364bf 100644 --- a/cmd/crossplane/render/op/load_test.go +++ b/cmd/crossplane/render/op/load_test.go @@ -102,13 +102,9 @@ spec: name: test-function` validOperation := &opsv1alpha1.Operation{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "ops.crossplane.io/v1alpha1", - Kind: "Operation", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "test-operation", - }, + APIVersion: "ops.crossplane.io/v1alpha1", + Kind: "Operation", + Name: "test-operation", Spec: opsv1alpha1.OperationSpec{ Mode: opsv1alpha1.OperationModePipeline, Pipeline: []opsv1alpha1.PipelineStep{ diff --git a/cmd/crossplane/top/top_test.go b/cmd/crossplane/top/top_test.go index 9ac8ca14..1a41033c 100644 --- a/cmd/crossplane/top/top_test.go +++ b/cmd/crossplane/top/top_test.go @@ -45,12 +45,10 @@ func TestGetCrossplanePods(t *testing.T) { reason: "Should return function pod", metrics: []corev1.Pod{ { - ObjectMeta: metav1.ObjectMeta{ - Name: "function-12345abcd-xyzwv", - Namespace: "crossplane-system", - Labels: map[string]string{ - v1.LabelFunction: "function-go-templating", - }, + Name: "function-12345abcd-xyzwv", + Namespace: "crossplane-system", + Labels: map[string]string{ + v1.LabelFunction: "function-go-templating", }, }, }, @@ -69,12 +67,10 @@ func TestGetCrossplanePods(t *testing.T) { reason: "Should return crossplane pod", metrics: []corev1.Pod{ { - ObjectMeta: metav1.ObjectMeta{ - Name: "crossplane-75575fcf5d-fzwgq", - Namespace: "crossplane-system", - Labels: map[string]string{ - "app.kubernetes.io/part-of": "crossplane", - }, + Name: "crossplane-75575fcf5d-fzwgq", + Namespace: "crossplane-system", + Labels: map[string]string{ + "app.kubernetes.io/part-of": "crossplane", }, }, }, @@ -93,21 +89,17 @@ func TestGetCrossplanePods(t *testing.T) { reason: "Should return multiple different pods types", metrics: []corev1.Pod{ { - ObjectMeta: metav1.ObjectMeta{ - Name: "function-go-templating-213wer", - Namespace: "crossplane-system", - Labels: map[string]string{ - v1.LabelFunction: "function-go-templating", - }, + Name: "function-go-templating-213wer", + Namespace: "crossplane-system", + Labels: map[string]string{ + v1.LabelFunction: "function-go-templating", }, }, { - ObjectMeta: metav1.ObjectMeta{ - Name: "provider-azure-storage", - Namespace: "crossplane-system", - Labels: map[string]string{ - v1.LabelProvider: "provider-azure-storage", - }, + Name: "provider-azure-storage", + Namespace: "crossplane-system", + Labels: map[string]string{ + v1.LabelProvider: "provider-azure-storage", }, }, }, @@ -130,12 +122,10 @@ func TestGetCrossplanePods(t *testing.T) { reason: "Should return new pod type 'extension'", metrics: []corev1.Pod{ { - ObjectMeta: metav1.ObjectMeta{ - Name: "extension-some-feature-12345", - Namespace: "crossplane-system", - Labels: map[string]string{ - "pkg.crossplane.io/extension": "new-crossplane-extension", - }, + Name: "extension-some-feature-12345", + Namespace: "crossplane-system", + Labels: map[string]string{ + "pkg.crossplane.io/extension": "new-crossplane-extension", }, }, }, diff --git a/cmd/crossplane/validate/validate_test.go b/cmd/crossplane/validate/validate_test.go index e5465a21..5437d183 100644 --- a/cmd/crossplane/validate/validate_test.go +++ b/cmd/crossplane/validate/validate_test.go @@ -30,13 +30,9 @@ import ( ) var testCRD = &extv1.CustomResourceDefinition{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "apiextensions.k8s.io/v1", - Kind: "CustomResourceDefinition", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "test", - }, + APIVersion: "apiextensions.k8s.io/v1", + Kind: "CustomResourceDefinition", + Name: "test", Spec: extv1.CustomResourceDefinitionSpec{ Group: "test.org", Names: extv1.CustomResourceDefinitionNames{ @@ -202,16 +198,14 @@ func TestConvertToCRDs(t *testing.T) { want: want{ crd: []*extv1.CustomResourceDefinition{ { - ObjectMeta: metav1.ObjectMeta{ - Name: "test", - OwnerReferences: []metav1.OwnerReference{ - { - APIVersion: "apiextensions.crossplane.io/v1", - Kind: "CompositeResourceDefinition", - Name: "test", - Controller: new(true), - BlockOwnerDeletion: new(true), - }, + Name: "test", + OwnerReferences: []metav1.OwnerReference{ + { + APIVersion: "apiextensions.crossplane.io/v1", + Kind: "CompositeResourceDefinition", + Name: "test", + Controller: new(true), + BlockOwnerDeletion: new(true), }, }, Spec: extv1.CustomResourceDefinitionSpec{ @@ -510,16 +504,14 @@ func TestConvertToCRDs(t *testing.T) { want: want{ crd: []*extv1.CustomResourceDefinition{ { - ObjectMeta: metav1.ObjectMeta{ - Name: "test", - OwnerReferences: []metav1.OwnerReference{ - { - APIVersion: "apiextensions.crossplane.io/v1", - Kind: "CompositeResourceDefinition", - Name: "test", - Controller: new(true), - BlockOwnerDeletion: new(true), - }, + Name: "test", + OwnerReferences: []metav1.OwnerReference{ + { + APIVersion: "apiextensions.crossplane.io/v1", + Kind: "CompositeResourceDefinition", + Name: "test", + Controller: new(true), + BlockOwnerDeletion: new(true), }, }, Spec: extv1.CustomResourceDefinitionSpec{ @@ -755,16 +747,14 @@ func TestConvertToCRDs(t *testing.T) { }, }, { - ObjectMeta: metav1.ObjectMeta{ - Name: "testclaims.test.org", - OwnerReferences: []metav1.OwnerReference{ - { - APIVersion: "apiextensions.crossplane.io/v1", - Kind: "CompositeResourceDefinition", - Name: "test", - Controller: new(true), - BlockOwnerDeletion: new(true), - }, + Name: "testclaims.test.org", + OwnerReferences: []metav1.OwnerReference{ + { + APIVersion: "apiextensions.crossplane.io/v1", + Kind: "CompositeResourceDefinition", + Name: "test", + Controller: new(true), + BlockOwnerDeletion: new(true), }, }, Spec: extv1.CustomResourceDefinitionSpec{ diff --git a/cmd/crossplane/version/fetch_integration_test.go b/cmd/crossplane/version/fetch_integration_test.go index 3e1765ed..d977eb27 100644 --- a/cmd/crossplane/version/fetch_integration_test.go +++ b/cmd/crossplane/version/fetch_integration_test.go @@ -47,7 +47,7 @@ func deployment(name string, labels map[string]string, image string) *appsv1.Dep sel := map[string]string{"pod": name} return &appsv1.Deployment{ - ObjectMeta: metav1.ObjectMeta{Name: name, Namespace: "crossplane-system", Labels: labels}, + Name: name, Namespace: "crossplane-system", Labels: labels, Spec: appsv1.DeploymentSpec{ Selector: &metav1.LabelSelector{MatchLabels: sel}, Template: corev1.PodTemplateSpec{ @@ -124,7 +124,7 @@ func TestFetchCrossplaneVersionIntegration(t *testing.T) { t.Run(name, func(t *testing.T) { cluster := integration.Start(t, integration.Setup{}) - ns := &corev1.Namespace{ObjectMeta: metav1.ObjectMeta{Name: "crossplane-system"}} + ns := &corev1.Namespace{Name: "crossplane-system"} if err := cluster.Client.Create(cluster.Context, ns); err != nil { t.Fatalf("cannot create namespace: %v", err) } diff --git a/cmd/crossplane/xpkg/get_crds_test.go b/cmd/crossplane/xpkg/get_crds_test.go index 3017ba4c..af28dc8c 100644 --- a/cmd/crossplane/xpkg/get_crds_test.go +++ b/cmd/crossplane/xpkg/get_crds_test.go @@ -34,13 +34,9 @@ import ( const schemaTypeObject = "object" var testCRD = &extv1.CustomResourceDefinition{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "apiextensions.k8s.io/v1", - Kind: "CustomResourceDefinition", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "tests.example.org", - }, + APIVersion: "apiextensions.k8s.io/v1", + Kind: "CustomResourceDefinition", + Name: "tests.example.org", Spec: extv1.CustomResourceDefinitionSpec{ Group: "example.org", Names: extv1.CustomResourceDefinitionNames{ @@ -119,7 +115,7 @@ func TestWriteCRDs(t *testing.T) { crds: []*extv1.CustomResourceDefinition{ testCRD, { - ObjectMeta: metav1.ObjectMeta{Name: "foos.example.org"}, + Name: "foos.example.org", Spec: extv1.CustomResourceDefinitionSpec{ Group: "example.org", Names: extv1.CustomResourceDefinitionNames{Kind: "Foo"}, @@ -230,7 +226,7 @@ func TestWriteJSONSchemas(t *testing.T) { args: args{ crds: []*extv1.CustomResourceDefinition{ { - ObjectMeta: metav1.ObjectMeta{Name: "nils.example.org"}, + Name: "nils.example.org", Spec: extv1.CustomResourceDefinitionSpec{ Group: "example.org", Names: extv1.CustomResourceDefinitionNames{Kind: "Nil"}, diff --git a/cmd/crossplane/xpkg/install.go b/cmd/crossplane/xpkg/install.go index 493d6fe3..3045bbb8 100644 --- a/cmd/crossplane/xpkg/install.go +++ b/cmd/crossplane/xpkg/install.go @@ -120,18 +120,18 @@ func (c *installCmd) Run(k *kong.Context, logger logging.Logger) error { switch c.Kind { case "provider": pkg = &v1.Provider{ - ObjectMeta: metav1.ObjectMeta{Name: pkgName}, - Spec: v1.ProviderSpec{PackageSpec: spec}, + Name: pkgName, + Spec: v1.ProviderSpec{PackageSpec: spec}, } case "configuration": pkg = &v1.Configuration{ - ObjectMeta: metav1.ObjectMeta{Name: pkgName}, - Spec: v1.ConfigurationSpec{PackageSpec: spec}, + Name: pkgName, + Spec: v1.ConfigurationSpec{PackageSpec: spec}, } case "function": pkg = &v1.Function{ - ObjectMeta: metav1.ObjectMeta{Name: pkgName}, - Spec: v1.FunctionSpec{PackageSpec: spec}, + Name: pkgName, + Spec: v1.FunctionSpec{PackageSpec: spec}, } default: // The enum struct tag on the Kind field should make this impossible. diff --git a/cmd/crossplane/xpkg/install_integration_test.go b/cmd/crossplane/xpkg/install_integration_test.go index 4c04a120..132bdca8 100644 --- a/cmd/crossplane/xpkg/install_integration_test.go +++ b/cmd/crossplane/xpkg/install_integration_test.go @@ -181,7 +181,7 @@ func TestInstallIntegration(t *testing.T) { reason: "Without a name the package is named for its repository, as a DNS label.", args: []string{"function", "xpkg.crossplane.io/crossplane-contrib/function-patch-and-transform:v0.8.0"}, want: want{ - obj: &v1.Function{ObjectMeta: metav1.ObjectMeta{Name: "crossplane-contrib-function-patch-and-transform"}}, + obj: &v1.Function{Name: "crossplane-contrib-function-patch-and-transform"}, spec: v1.PackageSpec{ Package: "xpkg.crossplane.io/crossplane-contrib/function-patch-and-transform:v0.8.0", RevisionActivationPolicy: &auto, @@ -193,7 +193,7 @@ func TestInstallIntegration(t *testing.T) { }, "AlreadyExists": { reason: "Installing a package under a name that is taken fails.", - existing: &v1.Provider{ObjectMeta: metav1.ObjectMeta{Name: "provider-taken"}, Spec: v1.ProviderSpec{PackageSpec: v1.PackageSpec{Package: "xpkg.crossplane.io/crossplane-contrib/provider-nop:v0.4.0"}}}, + existing: &v1.Provider{Name: "provider-taken", Spec: v1.ProviderSpec{PackageSpec: v1.PackageSpec{Package: "xpkg.crossplane.io/crossplane-contrib/provider-nop:v0.4.0"}}}, args: []string{"provider", "xpkg.crossplane.io/crossplane-contrib/provider-nop:v0.4.0", "provider-taken"}, want: want{err: errors.Wrap(kerrors.NewAlreadyExists(schema.GroupResource{Group: "pkg.crossplane.io", Resource: "providers"}, "provider-taken"), "cannot create package")}, @@ -328,7 +328,7 @@ func TestInstallMissingCRDIntegration(t *testing.T) { cluster := startInstallCluster(t) // Start always serves Crossplane's CRDs, so remove the one this case needs gone. - crd := &extv1.CustomResourceDefinition{ObjectMeta: metav1.ObjectMeta{Name: "providers.pkg.crossplane.io"}} + crd := &extv1.CustomResourceDefinition{Name: "providers.pkg.crossplane.io"} if err := cluster.Client.Delete(cluster.Context, crd); err != nil { t.Fatalf("cannot delete the Provider CRD: %v", err) } diff --git a/cmd/crossplane/xpkg/push.go b/cmd/crossplane/xpkg/push.go index de5dd710..391cee62 100644 --- a/cmd/crossplane/xpkg/push.go +++ b/cmd/crossplane/xpkg/push.go @@ -186,14 +186,12 @@ func pushSingle(ctx context.Context, adds *[]mutate.IndexAddendum, i int, pi pac } (*adds)[i] = mutate.IndexAddendum{ - Add: img, - Descriptor: v1.Descriptor{ - MediaType: mt, - Platform: &v1.Platform{ - Architecture: conf.Architecture, - OS: conf.OS, - OSVersion: conf.OSVersion, - }, + Add: img, + MediaType: mt, + Platform: &v1.Platform{ + Architecture: conf.Architecture, + OS: conf.OS, + OSVersion: conf.OSVersion, }, } if err := remote.Write(ref, img, append(options, remote.WithContext(ctx))...); err != nil { diff --git a/cmd/crossplane/xrd/convert_test.go b/cmd/crossplane/xrd/convert_test.go index d6d0d615..fdbb4eca 100644 --- a/cmd/crossplane/xrd/convert_test.go +++ b/cmd/crossplane/xrd/convert_test.go @@ -246,7 +246,7 @@ func newKongContext(t *testing.T) *kong.Context { // satisfy xcrd.ForCompositeResource / xcrd.ForCompositeResourceClaim. func minimalXRD(scope apiextensionsv1.CompositeResourceScope, claimNames *extv1.CustomResourceDefinitionNames) *apiextensionsv1.CompositeResourceDefinition { return &apiextensionsv1.CompositeResourceDefinition{ - ObjectMeta: metav1.ObjectMeta{Name: "xtestapps.example.org"}, + Name: "xtestapps.example.org", Spec: apiextensionsv1.CompositeResourceDefinitionSpec{ Group: "example.org", Names: extv1.CustomResourceDefinitionNames{ diff --git a/cmd/crossplane/xrd/generate.go b/cmd/crossplane/xrd/generate.go index 487851d1..6a5ca78b 100644 --- a/cmd/crossplane/xrd/generate.go +++ b/cmd/crossplane/xrd/generate.go @@ -291,13 +291,9 @@ func newXRDFromSimpleSchema(yamlData []byte, customPlural string) (*v2.Composite } return &v2.CompositeResourceDefinition{ - TypeMeta: metav1.TypeMeta{ - APIVersion: v2.CompositeResourceDefinitionGroupVersionKind.GroupVersion().String(), - Kind: v2.CompositeResourceDefinitionGroupVersionKind.Kind, - }, - ObjectMeta: metav1.ObjectMeta{ - Name: strings.ToLower(fmt.Sprintf("%s.%s", plural, gv.Group)), - }, + APIVersion: v2.CompositeResourceDefinitionGroupVersionKind.GroupVersion().String(), + Kind: v2.CompositeResourceDefinitionGroupVersionKind.Kind, + Name: strings.ToLower(fmt.Sprintf("%s.%s", plural, gv.Group)), Spec: v2.CompositeResourceDefinitionSpec{ Group: gv.Group, Scope: v2.CompositeResourceScopeNamespaced, @@ -435,13 +431,9 @@ func newXRDFromExample(yamlData []byte, customPlural string) (*v2.CompositeResou } return &v2.CompositeResourceDefinition{ - TypeMeta: metav1.TypeMeta{ - APIVersion: v2.CompositeResourceDefinitionGroupVersionKind.GroupVersion().String(), - Kind: v2.CompositeResourceDefinitionGroupVersionKind.Kind, - }, - ObjectMeta: metav1.ObjectMeta{ - Name: strings.ToLower(fmt.Sprintf("%s.%s", plural, gv.Group)), - }, + APIVersion: v2.CompositeResourceDefinitionGroupVersionKind.GroupVersion().String(), + Kind: v2.CompositeResourceDefinitionGroupVersionKind.Kind, + Name: strings.ToLower(fmt.Sprintf("%s.%s", plural, gv.Group)), Spec: v2.CompositeResourceDefinitionSpec{ Group: gv.Group, Scope: scope, diff --git a/cmd/crossplane/xrd/generate_test.go b/cmd/crossplane/xrd/generate_test.go index e75880b5..1e6a5c44 100644 --- a/cmd/crossplane/xrd/generate_test.go +++ b/cmd/crossplane/xrd/generate_test.go @@ -66,13 +66,9 @@ spec: }, want: want{ xrd: &v2.CompositeResourceDefinition{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "apiextensions.crossplane.io/v2", - Kind: "CompositeResourceDefinition", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "xeks.aws.u5d.io", - }, + APIVersion: "apiextensions.crossplane.io/v2", + Kind: "CompositeResourceDefinition", + Name: "xeks.aws.u5d.io", Spec: v2.CompositeResourceDefinitionSpec{ Group: "aws.u5d.io", Scope: v2.CompositeResourceScopeCluster, @@ -135,13 +131,9 @@ spec: }, want: want{ xrd: &v2.CompositeResourceDefinition{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "apiextensions.crossplane.io/v2", - Kind: "CompositeResourceDefinition", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "eks.aws.u5d.io", - }, + APIVersion: "apiextensions.crossplane.io/v2", + Kind: "CompositeResourceDefinition", + Name: "eks.aws.u5d.io", Spec: v2.CompositeResourceDefinitionSpec{ Group: "aws.u5d.io", Scope: v2.CompositeResourceScopeNamespaced, @@ -202,13 +194,9 @@ spec: }, want: want{ xrd: &v2.CompositeResourceDefinition{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "apiextensions.crossplane.io/v2", - Kind: "CompositeResourceDefinition", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "postgreses.database.u5d.io", - }, + APIVersion: "apiextensions.crossplane.io/v2", + Kind: "CompositeResourceDefinition", + Name: "postgreses.database.u5d.io", Spec: v2.CompositeResourceDefinitionSpec{ Group: "database.u5d.io", Scope: v2.CompositeResourceScopeCluster, @@ -269,13 +257,9 @@ status: }, want: want{ xrd: &v2.CompositeResourceDefinition{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "apiextensions.crossplane.io/v2", - Kind: "CompositeResourceDefinition", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "buckets.storage.u5d.io", - }, + APIVersion: "apiextensions.crossplane.io/v2", + Kind: "CompositeResourceDefinition", + Name: "buckets.storage.u5d.io", Spec: v2.CompositeResourceDefinitionSpec{ Group: "storage.u5d.io", Scope: v2.CompositeResourceScopeCluster, @@ -350,13 +334,9 @@ spec: }, want: want{ xrd: &v2.CompositeResourceDefinition{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "apiextensions.crossplane.io/v2", - Kind: "CompositeResourceDefinition", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "xeks.aws.u5d.io", - }, + APIVersion: "apiextensions.crossplane.io/v2", + Kind: "CompositeResourceDefinition", + Name: "xeks.aws.u5d.io", Spec: v2.CompositeResourceDefinitionSpec{ Group: "aws.u5d.io", Scope: v2.CompositeResourceScopeCluster, @@ -566,13 +546,9 @@ spec: }, want: want{ xrd: &v2.CompositeResourceDefinition{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "apiextensions.crossplane.io/v2", - Kind: "CompositeResourceDefinition", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "xeks.aws.u5d.io", - }, + APIVersion: "apiextensions.crossplane.io/v2", + Kind: "CompositeResourceDefinition", + Name: "xeks.aws.u5d.io", Spec: v2.CompositeResourceDefinitionSpec{ Group: "aws.u5d.io", Scope: v2.CompositeResourceScopeNamespaced, @@ -629,13 +605,9 @@ status: }, want: want{ xrd: &v2.CompositeResourceDefinition{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "apiextensions.crossplane.io/v2", - Kind: "CompositeResourceDefinition", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "xeks.aws.u5d.io", - }, + APIVersion: "apiextensions.crossplane.io/v2", + Kind: "CompositeResourceDefinition", + Name: "xeks.aws.u5d.io", Spec: v2.CompositeResourceDefinitionSpec{ Group: "aws.u5d.io", Scope: v2.CompositeResourceScopeNamespaced, @@ -691,13 +663,9 @@ spec: }, want: want{ xrd: &v2.CompositeResourceDefinition{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "apiextensions.crossplane.io/v2", - Kind: "CompositeResourceDefinition", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "postgreses.database.u5d.io", - }, + APIVersion: "apiextensions.crossplane.io/v2", + Kind: "CompositeResourceDefinition", + Name: "postgreses.database.u5d.io", Spec: v2.CompositeResourceDefinitionSpec{ Group: "database.u5d.io", Scope: v2.CompositeResourceScopeNamespaced, @@ -756,13 +724,9 @@ customTypes: }, want: want{ xrd: &v2.CompositeResourceDefinition{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "apiextensions.crossplane.io/v2", - Kind: "CompositeResourceDefinition", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "xeks.aws.u5d.io", - }, + APIVersion: "apiextensions.crossplane.io/v2", + Kind: "CompositeResourceDefinition", + Name: "xeks.aws.u5d.io", Spec: v2.CompositeResourceDefinitionSpec{ Group: "aws.u5d.io", Scope: v2.CompositeResourceScopeNamespaced, diff --git a/internal/containerruntime/run_test.go b/internal/containerruntime/run_test.go index 3df7f374..b028bf5d 100644 --- a/internal/containerruntime/run_test.go +++ b/internal/containerruntime/run_test.go @@ -320,7 +320,7 @@ func ctr(id string, state container.ContainerState, labels map[string]string, ne } func net(name string, labels map[string]string) network.Summary { - return network.Summary{Network: network.Network{ID: name, Name: name, Labels: labels}} + return network.Summary{ID: name, Name: name, Labels: labels} } // hostContainers is a Docker host shared by three dead runs, a live run, this diff --git a/internal/dependency/manager_test.go b/internal/dependency/manager_test.go index 53e388f1..38a7def1 100644 --- a/internal/dependency/manager_test.go +++ b/internal/dependency/manager_test.go @@ -508,11 +508,9 @@ func TestManager_AddDependency(t *testing.T) { projFS := afero.NewMemMapFs() proj := &v1alpha1.Project{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "dev.crossplane.io/v1alpha1", - Kind: "Project", - }, - ObjectMeta: metav1.ObjectMeta{Name: "test-project"}, + APIVersion: "dev.crossplane.io/v1alpha1", + Kind: "Project", + Name: "test-project", Spec: v1alpha1.ProjectSpec{ Repository: "xpkg.crossplane.io/test/test", Dependencies: tc.inputDeps, @@ -674,8 +672,8 @@ func refRepo(ref string) string { if repo, _, ok := strings.Cut(ref, "@"); ok { return repo } - if i := strings.LastIndex(ref, ":"); i >= 0 { - return ref[:i] + if before, _, ok := strings.CutLast(ref, ":"); ok { + return before } return ref } @@ -945,11 +943,9 @@ func TestManager_AddDependency_TransitiveNotPersisted(t *testing.T) { projFS := afero.NewMemMapFs() proj := &v1alpha1.Project{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "dev.crossplane.io/v1alpha1", - Kind: "Project", - }, - ObjectMeta: metav1.ObjectMeta{Name: "test-project"}, + APIVersion: "dev.crossplane.io/v1alpha1", + Kind: "Project", + Name: "test-project", Spec: v1alpha1.ProjectSpec{ Repository: "xpkg.crossplane.io/test/test", Paths: &v1alpha1.ProjectPaths{Schemas: "schemas"}, diff --git a/internal/diff/client/client_test.go b/internal/diff/client/client_test.go index e211a163..f70bc0ea 100644 --- a/internal/diff/client/client_test.go +++ b/internal/diff/client/client_test.go @@ -37,8 +37,8 @@ func TestNew(t *testing.T) { "InvalidTLS": { reason: "A config with unusable TLS data should fail client creation.", config: &rest.Config{ - Host: "https://example.com", - TLSClientConfig: rest.TLSClientConfig{CAData: []byte("not a cert"), CertData: []byte("x")}, + Host: "https://example.com", + CAData: []byte("not a cert"), CertData: []byte("x"), }, err: true, }, diff --git a/internal/diff/client/crossplane/composition_client_test.go b/internal/diff/client/crossplane/composition_client_test.go index 7c6c573b..31bf8b14 100644 --- a/internal/diff/client/crossplane/composition_client_test.go +++ b/internal/diff/client/crossplane/composition_client_test.go @@ -555,9 +555,7 @@ func TestDefaultCompositionClient_FindMatchingComposition(t *testing.T) { }, want: want{ composition: &apiextensionsv1.Composition{ - ObjectMeta: metav1.ObjectMeta{ - Name: "matching-comp", - }, + Name: "matching-comp", Spec: apiextensionsv1.CompositionSpec{ CompositeTypeRef: apiextensionsv1.TypeReference{ APIVersion: "example.org/v2", @@ -725,9 +723,7 @@ func TestDefaultCompositionClient_FindMatchingComposition(t *testing.T) { }, want: want{ composition: &apiextensionsv1.Composition{ - ObjectMeta: metav1.ObjectMeta{ - Name: "matching-comp", - }, + Name: "matching-comp", Spec: apiextensionsv1.CompositionSpec{ CompositeTypeRef: apiextensionsv1.TypeReference{ APIVersion: "example.org/v2", @@ -1308,11 +1304,9 @@ func TestDefaultCompositionClient_ResolveCompositionFromRevisions(t *testing.T) // Create test revisions rev1 := &apiextensionsv1.CompositionRevision{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-comp-rev1", - Labels: map[string]string{ - LabelCompositionName: "test-comp", - }, + Name: "test-comp-rev1", + Labels: map[string]string{ + LabelCompositionName: "test-comp", }, Spec: apiextensionsv1.CompositionRevisionSpec{ Revision: 1, @@ -1324,11 +1318,9 @@ func TestDefaultCompositionClient_ResolveCompositionFromRevisions(t *testing.T) } rev2 := &apiextensionsv1.CompositionRevision{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-comp-rev2", - Labels: map[string]string{ - LabelCompositionName: "test-comp", - }, + Name: "test-comp-rev2", + Labels: map[string]string{ + LabelCompositionName: "test-comp", }, Spec: apiextensionsv1.CompositionRevisionSpec{ Revision: 2, @@ -1578,11 +1570,9 @@ func TestDefaultCompositionClient_ResolveCompositionFromRevisions(t *testing.T) WithGetResource(func(_ context.Context, _ schema.GroupVersionKind, _, name string) (*un.Unstructured, error) { if name == "other-comp-rev1" { wrongRev := &apiextensionsv1.CompositionRevision{ - ObjectMeta: metav1.ObjectMeta{ - Name: "other-comp-rev1", - Labels: map[string]string{ - LabelCompositionName: "other-comp", - }, + Name: "other-comp-rev1", + Labels: map[string]string{ + LabelCompositionName: "other-comp", }, Spec: apiextensionsv1.CompositionRevisionSpec{ Revision: 1, diff --git a/internal/diff/client/crossplane/composition_revision_client_test.go b/internal/diff/client/crossplane/composition_revision_client_test.go index ac84e92b..f7043017 100644 --- a/internal/diff/client/crossplane/composition_revision_client_test.go +++ b/internal/diff/client/crossplane/composition_revision_client_test.go @@ -64,11 +64,9 @@ func TestDefaultCompositionRevisionClient_GetCompositionRevision(t *testing.T) { // Create a test composition revision testRev := &apiextensionsv1.CompositionRevision{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-comp-abc123", - Labels: map[string]string{ - LabelCompositionName: "test-comp", - }, + Name: "test-comp-abc123", + Labels: map[string]string{ + LabelCompositionName: "test-comp", }, Spec: apiextensionsv1.CompositionRevisionSpec{ Revision: 1, @@ -178,11 +176,9 @@ func TestDefaultCompositionRevisionClient_GetLatestRevisionForComposition(t *tes // Create test revisions rev1 := &apiextensionsv1.CompositionRevision{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-comp-rev1", - Labels: map[string]string{ - LabelCompositionName: "test-comp", - }, + Name: "test-comp-rev1", + Labels: map[string]string{ + LabelCompositionName: "test-comp", }, Spec: apiextensionsv1.CompositionRevisionSpec{ Revision: 1, @@ -194,11 +190,9 @@ func TestDefaultCompositionRevisionClient_GetLatestRevisionForComposition(t *tes } rev2 := &apiextensionsv1.CompositionRevision{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-comp-rev2", - Labels: map[string]string{ - LabelCompositionName: "test-comp", - }, + Name: "test-comp-rev2", + Labels: map[string]string{ + LabelCompositionName: "test-comp", }, Spec: apiextensionsv1.CompositionRevisionSpec{ Revision: 2, @@ -210,11 +204,9 @@ func TestDefaultCompositionRevisionClient_GetLatestRevisionForComposition(t *tes } rev3 := &apiextensionsv1.CompositionRevision{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-comp-rev3", - Labels: map[string]string{ - LabelCompositionName: "test-comp", - }, + Name: "test-comp-rev3", + Labels: map[string]string{ + LabelCompositionName: "test-comp", }, Spec: apiextensionsv1.CompositionRevisionSpec{ Revision: 3, @@ -227,11 +219,9 @@ func TestDefaultCompositionRevisionClient_GetLatestRevisionForComposition(t *tes // Create duplicate revision numbers (error case) duplicateRev1 := &apiextensionsv1.CompositionRevision{ - ObjectMeta: metav1.ObjectMeta{ - Name: "dup-comp-rev1", - Labels: map[string]string{ - LabelCompositionName: "dup-comp", - }, + Name: "dup-comp-rev1", + Labels: map[string]string{ + LabelCompositionName: "dup-comp", }, Spec: apiextensionsv1.CompositionRevisionSpec{ Revision: 5, @@ -243,11 +233,9 @@ func TestDefaultCompositionRevisionClient_GetLatestRevisionForComposition(t *tes } duplicateRev2 := &apiextensionsv1.CompositionRevision{ - ObjectMeta: metav1.ObjectMeta{ - Name: "dup-comp-rev2", - Labels: map[string]string{ - LabelCompositionName: "dup-comp", - }, + Name: "dup-comp-rev2", + Labels: map[string]string{ + LabelCompositionName: "dup-comp", }, Spec: apiextensionsv1.CompositionRevisionSpec{ Revision: 5, // Same revision number as duplicateRev1 @@ -421,7 +409,7 @@ func TestDefaultCompositionRevisionClient_GetLatestRevisionForComposition_Select maps.Copy(lbls, extraLabels) return &apiextensionsv1.CompositionRevision{ - ObjectMeta: metav1.ObjectMeta{Name: name, Labels: lbls}, + Name: name, Labels: lbls, Spec: apiextensionsv1.CompositionRevisionSpec{ Revision: revision, CompositeTypeRef: apiextensionsv1.TypeReference{APIVersion: "example.org/v1", Kind: "XR1"}, @@ -555,11 +543,9 @@ func TestDefaultCompositionRevisionClient_GetCompositionFromRevision(t *testing. "ValidRevision": { reason: "Should extract composition from revision", revision: &apiextensionsv1.CompositionRevision{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-comp-abc123", - Labels: map[string]string{ - LabelCompositionName: "test-comp", - }, + Name: "test-comp-abc123", + Labels: map[string]string{ + LabelCompositionName: "test-comp", }, Spec: apiextensionsv1.CompositionRevisionSpec{ Revision: 1, @@ -578,9 +564,7 @@ func TestDefaultCompositionRevisionClient_GetCompositionFromRevision(t *testing. }, }, expectComp: &apiextensionsv1.Composition{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-comp", - }, + Name: "test-comp", Spec: apiextensionsv1.CompositionSpec{ CompositeTypeRef: apiextensionsv1.TypeReference{ APIVersion: "example.org/v1", @@ -607,9 +591,7 @@ func TestDefaultCompositionRevisionClient_GetCompositionFromRevision(t *testing. "NoLabelUsesRevisionName": { reason: "Should use revision name when label is missing", revision: &apiextensionsv1.CompositionRevision{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-comp-abc123", - }, + Name: "test-comp-abc123", Spec: apiextensionsv1.CompositionRevisionSpec{ Revision: 1, CompositeTypeRef: apiextensionsv1.TypeReference{ @@ -679,8 +661,8 @@ func TestDefaultCompositionRevisionClient_ConcurrentUse(t *testing.T) { WithGetResourcesByLabel(func(_ context.Context, _ schema.GroupVersionKind, _ string, sel metav1.LabelSelector) ([]*un.Unstructured, error) { comp := sel.MatchLabels[LabelCompositionName] rev := &apiextensionsv1.CompositionRevision{ - ObjectMeta: metav1.ObjectMeta{Name: comp + "-rev1", Labels: map[string]string{LabelCompositionName: comp}}, - Spec: apiextensionsv1.CompositionRevisionSpec{Revision: 1}, + Name: comp + "-rev1", Labels: map[string]string{LabelCompositionName: comp}, + Spec: apiextensionsv1.CompositionRevisionSpec{Revision: 1}, } obj, err := runtime.DefaultUnstructuredConverter.ToUnstructured(rev) diff --git a/internal/diff/client/crossplane/function_client_test.go b/internal/diff/client/crossplane/function_client_test.go index a39eaf2e..41e0f57f 100644 --- a/internal/diff/client/crossplane/function_client_test.go +++ b/internal/diff/client/crossplane/function_client_test.go @@ -180,22 +180,14 @@ func TestDefaultFunctionClient_GetFunctionsFromPipeline(t *testing.T) { want: want{ functions: []pkgv1.Function{ { - TypeMeta: metav1.TypeMeta{ - APIVersion: "pkg.crossplane.io/v1", - Kind: "Function", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "function-a", - }, + APIVersion: "pkg.crossplane.io/v1", + Kind: "Function", + Name: "function-a", }, { - TypeMeta: metav1.TypeMeta{ - APIVersion: "pkg.crossplane.io/v1", - Kind: "Function", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "function-b", - }, + APIVersion: "pkg.crossplane.io/v1", + Kind: "Function", + Name: "function-b", }, }, }, @@ -229,22 +221,14 @@ func TestDefaultFunctionClient_GetFunctionsFromPipeline(t *testing.T) { want: want{ functions: []pkgv1.Function{ { - TypeMeta: metav1.TypeMeta{ - APIVersion: "pkg.crossplane.io/v1", - Kind: "Function", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "function-a", - }, + APIVersion: "pkg.crossplane.io/v1", + Kind: "Function", + Name: "function-a", }, { - TypeMeta: metav1.TypeMeta{ - APIVersion: "pkg.crossplane.io/v1", - Kind: "Function", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "function-a", - }, + APIVersion: "pkg.crossplane.io/v1", + Kind: "Function", + Name: "function-a", }, }, }, diff --git a/internal/diff/diffprocessor/comp_processor.go b/internal/diff/diffprocessor/comp_processor.go index 55cc47e2..b04eb176 100644 --- a/internal/diff/diffprocessor/comp_processor.go +++ b/internal/diff/diffprocessor/comp_processor.go @@ -526,13 +526,11 @@ func (p *DefaultCompDiffProcessor) processSingleComposition(ctx context.Context, // list them or only count them is the renderer's decision (see CompositionDiff.Scoped). for _, d := range droppedXRs { result.ImpactAnalysis = append(result.ImpactAnalysis, dt.XRImpact{ - ComposedBy: parentCompositeRef(d.xr, nil), - ObjectReference: corev1.ObjectReference{ - APIVersion: d.xr.GetAPIVersion(), - Kind: d.xr.GetKind(), - Name: d.xr.GetName(), - Namespace: d.xr.GetNamespace(), - }, + ComposedBy: parentCompositeRef(d.xr, nil), + APIVersion: d.xr.GetAPIVersion(), + Kind: d.xr.GetKind(), + Name: d.xr.GetName(), + Namespace: d.xr.GetNamespace(), Status: dt.XRStatusFiltered, FilterReason: d.reason, FilterDetail: d.detail, diff --git a/internal/diff/diffprocessor/comp_processor_test.go b/internal/diff/diffprocessor/comp_processor_test.go index abb07075..d90e7bdd 100644 --- a/internal/diff/diffprocessor/comp_processor_test.go +++ b/internal/diff/diffprocessor/comp_processor_test.go @@ -2178,10 +2178,10 @@ func TestDefaultCompDiffProcessor_DiffComposition_ResourceMode(t *testing.T) { filtered := func(name, detail string) dt.XRImpact { return dt.XRImpact{ - ObjectReference: corev1.ObjectReference{APIVersion: "example.org/v1", Kind: "XR", Name: name, Namespace: "ns"}, - Status: dt.XRStatusFiltered, - FilterReason: dt.FilterReasonManualPolicy, - FilterDetail: detail, + APIVersion: "example.org/v1", Kind: "XR", Name: name, Namespace: "ns", + Status: dt.XRStatusFiltered, + FilterReason: dt.FilterReasonManualPolicy, + FilterDetail: detail, } } diff --git a/internal/diff/diffprocessor/diff_processor_test.go b/internal/diff/diffprocessor/diff_processor_test.go index f046f18e..89da9988 100644 --- a/internal/diff/diffprocessor/diff_processor_test.go +++ b/internal/diff/diffprocessor/diff_processor_test.go @@ -409,9 +409,7 @@ func TestDefaultDiffProcessor_PerformDiff(t *testing.T) { // Create mock functions that render will call successfully functions := []pkgv1.Function{ { - ObjectMeta: metav1.ObjectMeta{ - Name: "function-test", - }, + Name: "function-test", }, } @@ -524,9 +522,7 @@ func TestDefaultDiffProcessor_PerformDiff(t *testing.T) { CompositeResource: in.CompositeResource, ComposedResources: []cpd.Unstructured{ { - Unstructured: un.Unstructured{ - Object: composedResource.Object, - }, + Object: composedResource.Object, }, }, }, nil @@ -594,9 +590,7 @@ func TestDefaultDiffProcessor_PerformDiff(t *testing.T) { // Create mock functions that render will call successfully functions := []pkgv1.Function{ { - ObjectMeta: metav1.ObjectMeta{ - Name: "function-test", - }, + Name: "function-test", }, } @@ -660,9 +654,7 @@ func TestDefaultDiffProcessor_PerformDiff(t *testing.T) { CompositeResource: in.CompositeResource, ComposedResources: []cpd.Unstructured{ { - Unstructured: un.Unstructured{ - Object: composedResource.Object, - }, + Object: composedResource.Object, }, }, }, nil @@ -744,7 +736,7 @@ func TestDefaultDiffProcessor_PerformDiff_Groups(t *testing.T) { WithPipelineStep("step1", "function-test", nil). Build() - functions := []pkgv1.Function{{ObjectMeta: metav1.ObjectMeta{Name: "function-test"}}} + functions := []pkgv1.Function{{Name: "function-test"}} xrd := tu.NewXRD(testXRDName, testGroup, testKind). WithPlural(testPlural). @@ -1411,7 +1403,7 @@ func TestDiffFetchesOnlyTheInputsCRD(t *testing.T) { Composition: tu.NewMockCompositionClient().WithSuccessfulCompositionMatch(composition).Build(), Credential: &tu.MockCredentialClient{}, Definition: defClient, - Function: tu.NewMockFunctionClient().WithSuccessfulFunctionsFetch([]pkgv1.Function{{ObjectMeta: metav1.ObjectMeta{Name: "function-test"}}}).Build(), + Function: tu.NewMockFunctionClient().WithSuccessfulFunctionsFetch([]pkgv1.Function{{Name: "function-test"}}).Build(), ResourceTree: tu.NewMockResourceTreeClient().WithEmptyResourceTree().Build(), } @@ -1522,9 +1514,7 @@ func TestDefaultDiffProcessor_RenderToStableState(t *testing.T) { // Create a composition with pipeline mode pipelineMode := apiextensionsv1.CompositionModePipeline composition := &apiextensionsv1.Composition{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-composition", - }, + Name: "test-composition", Spec: apiextensionsv1.CompositionSpec{ Mode: pipelineMode, }, @@ -1533,9 +1523,7 @@ func TestDefaultDiffProcessor_RenderToStableState(t *testing.T) { // Create test functions functions := []pkgv1.Function{ { - ObjectMeta: metav1.ObjectMeta{ - Name: "test-function", - }, + Name: "test-function", }, } @@ -1578,13 +1566,13 @@ func TestDefaultDiffProcessor_RenderToStableState(t *testing.T) { return render.CompositionOutputs{ CompositeResource: in.CompositeResource, ComposedResources: []cpd.Unstructured{ - {Unstructured: un.Unstructured{Object: map[string]any{ + {Object: map[string]any{ "apiVersion": "example.org/v1", "kind": "ComposedResource", "metadata": map[string]any{ "name": "composed1", }, - }}}, + }}, }, }, nil } @@ -1636,13 +1624,13 @@ func TestDefaultDiffProcessor_RenderToStableState(t *testing.T) { return render.CompositionOutputs{ CompositeResource: in.CompositeResource, ComposedResources: []cpd.Unstructured{ - {Unstructured: un.Unstructured{Object: map[string]any{ + {Object: map[string]any{ "apiVersion": "example.org/v1", "kind": "ComposedResource", "metadata": map[string]any{ "name": "composed1", }, - }}}, + }}, }, RequiredResources: reqs, }, nil @@ -1727,13 +1715,13 @@ func TestDefaultDiffProcessor_RenderToStableState(t *testing.T) { return render.CompositionOutputs{ CompositeResource: in.CompositeResource, ComposedResources: []cpd.Unstructured{ - {Unstructured: un.Unstructured{Object: map[string]any{ + {Object: map[string]any{ "apiVersion": "example.org/v1", "kind": "ComposedResource", "metadata": map[string]any{ "name": "composed1", }, - }}}, + }}, }, RequiredResources: requirements, }, nil @@ -1806,13 +1794,13 @@ func TestDefaultDiffProcessor_RenderToStableState(t *testing.T) { return render.CompositionOutputs{ CompositeResource: in.CompositeResource, ComposedResources: []cpd.Unstructured{ - {Unstructured: un.Unstructured{Object: map[string]any{ + {Object: map[string]any{ "apiVersion": "example.org/v1", "kind": "ComposedResource", "metadata": map[string]any{ "name": "composed1", }, - }}}, + }}, }, }, nil } @@ -1958,7 +1946,7 @@ func TestDefaultDiffProcessor_RenderToStableState(t *testing.T) { functions: functions, resourceID: "XR/test-xr", observedResources: []cpd.Unstructured{ - {Unstructured: un.Unstructured{Object: map[string]any{ + {Object: map[string]any{ "apiVersion": "s3.aws.crossplane.io/v1", "kind": "Bucket", "metadata": map[string]any{ @@ -1967,8 +1955,8 @@ func TestDefaultDiffProcessor_RenderToStableState(t *testing.T) { "crossplane.io/composition-resource-name": "bucket", }, }, - }}}, - {Unstructured: un.Unstructured{Object: map[string]any{ + }}, + {Object: map[string]any{ "apiVersion": "iam.aws.crossplane.io/v1", "kind": "User", "metadata": map[string]any{ @@ -1977,7 +1965,7 @@ func TestDefaultDiffProcessor_RenderToStableState(t *testing.T) { "crossplane.io/composition-resource-name": "user", }, }, - }}}, + }}, }, setupResourceClient: func() *tu.MockResourceClient { return tu.NewMockResourceClient().Build() @@ -2002,13 +1990,13 @@ func TestDefaultDiffProcessor_RenderToStableState(t *testing.T) { return render.CompositionOutputs{ CompositeResource: in.CompositeResource, ComposedResources: []cpd.Unstructured{ - {Unstructured: un.Unstructured{Object: map[string]any{ + {Object: map[string]any{ "apiVersion": "example.org/v1", "kind": "ComposedResource", "metadata": map[string]any{ "name": "composed1", }, - }}}, + }}, }, }, nil } @@ -2094,11 +2082,11 @@ func TestDefaultDiffProcessor_RenderToStableState_SynthesizeReady(t *testing.T) // Create a composition with pipeline mode pipelineMode := apiextensionsv1.CompositionModePipeline composition := &apiextensionsv1.Composition{ - ObjectMeta: metav1.ObjectMeta{Name: "test-composition"}, - Spec: apiextensionsv1.CompositionSpec{Mode: pipelineMode}, + Name: "test-composition", + Spec: apiextensionsv1.CompositionSpec{Mode: pipelineMode}, } - functions := []pkgv1.Function{{ObjectMeta: metav1.ObjectMeta{Name: "test-function"}}} + functions := []pkgv1.Function{{Name: "test-function"}} // Fixtures for an XR that already exists: its stage0 is observed in the cluster, and stage1 // renders only once observed stage0 is Ready, the way function-sequencer or a template's own @@ -2158,11 +2146,11 @@ func TestDefaultDiffProcessor_RenderToStableState_SynthesizeReady(t *testing.T) return render.CompositionOutputs{ CompositeResource: in.CompositeResource, ComposedResources: []cpd.Unstructured{{ - Unstructured: un.Unstructured{Object: map[string]any{ + Object: map[string]any{ "apiVersion": "example.org/v1", "kind": "ComposedResource", "metadata": map[string]any{"name": "composed1"}, - }}, + }, }}, }, nil } @@ -2192,30 +2180,30 @@ func TestDefaultDiffProcessor_RenderToStableState_SynthesizeReady(t *testing.T) // Stage 3: resource1,2 ready -> produce resource1 + resource2 + resource3 // Stage 4: All ready, stable resources := []cpd.Unstructured{{ - Unstructured: un.Unstructured{Object: map[string]any{ + Object: map[string]any{ "apiVersion": "example.org/v1", "kind": "Stage1Resource", "metadata": map[string]any{"name": "resource1"}, - }}, + }, }} if readyCount >= 1 { resources = append(resources, cpd.Unstructured{ - Unstructured: un.Unstructured{Object: map[string]any{ + Object: map[string]any{ "apiVersion": "example.org/v1", "kind": "Stage2Resource", "metadata": map[string]any{"name": "resource2"}, - }}, + }, }) } if readyCount >= 2 { resources = append(resources, cpd.Unstructured{ - Unstructured: un.Unstructured{Object: map[string]any{ + Object: map[string]any{ "apiVersion": "example.org/v1", "kind": "Stage3Resource", "metadata": map[string]any{"name": "resource3"}, - }}, + }, }) } @@ -2268,7 +2256,7 @@ func TestDefaultDiffProcessor_RenderToStableState_SynthesizeReady(t *testing.T) return render.CompositionOutputs{ CompositeResource: in.CompositeResource, ComposedResources: []cpd.Unstructured{{ - Unstructured: un.Unstructured{Object: map[string]any{ + Object: map[string]any{ "apiVersion": "example.org/v1", "kind": "InfiniteResource", "metadata": map[string]any{ @@ -2277,7 +2265,7 @@ func TestDefaultDiffProcessor_RenderToStableState_SynthesizeReady(t *testing.T) "crossplane.io/composition-resource-name": fmt.Sprintf("res%d", resourceNum), }, }, - }}, + }, }}, }, nil } @@ -2621,7 +2609,7 @@ func TestDefaultDiffProcessor_ProcessNestedXRs(t *testing.T) { // XR and can have its XRD defaults applied. cycleClients := func() (xp.Clients, k8.Clients) { functions := []pkgv1.Function{ - {ObjectMeta: metav1.ObjectMeta{Name: "function-go-templating"}}, + {Name: "function-go-templating"}, } xpClients := xp.Clients{ @@ -2713,9 +2701,7 @@ func TestDefaultDiffProcessor_ProcessNestedXRs(t *testing.T) { // Create functions that the composition references functions := []pkgv1.Function{ { - ObjectMeta: metav1.ObjectMeta{ - Name: "function-go-templating", - }, + Name: "function-go-templating", Spec: pkgv1.FunctionSpec{ PackageSpec: pkgv1.PackageSpec{ Package: "xpkg.crossplane.io/crossplane-contrib/function-go-templating:v0.11.0", @@ -2854,9 +2840,7 @@ func TestDefaultDiffProcessor_ProcessNestedXRs(t *testing.T) { // Create functions that the composition references functions := []pkgv1.Function{ { - ObjectMeta: metav1.ObjectMeta{ - Name: "function-go-templating", - }, + Name: "function-go-templating", Spec: pkgv1.FunctionSpec{ PackageSpec: pkgv1.PackageSpec{ Package: "xpkg.crossplane.io/crossplane-contrib/function-go-templating:v0.11.0", @@ -2959,9 +2943,7 @@ func TestDefaultDiffProcessor_ProcessNestedXRs(t *testing.T) { // Create functions functions := []pkgv1.Function{ { - ObjectMeta: metav1.ObjectMeta{ - Name: "function-go-templating", - }, + Name: "function-go-templating", Spec: pkgv1.FunctionSpec{ PackageSpec: pkgv1.PackageSpec{ Package: "xpkg.crossplane.io/crossplane-contrib/function-go-templating:v0.11.0", @@ -3139,9 +3121,7 @@ func TestDefaultDiffProcessor_DiffSingleResource_WithObservedResources(t *testin // Create test functions functions := []pkgv1.Function{ { - ObjectMeta: metav1.ObjectMeta{ - Name: "function-test", - }, + Name: "function-test", }, } @@ -3589,7 +3569,7 @@ func TestDefaultDiffProcessor_DiffSingleResource_RevisionRef(t *testing.T) { WithPipelineStep("step1", "function-test", nil). Build() - functions := []pkgv1.Function{{ObjectMeta: metav1.ObjectMeta{Name: "function-test"}}} + functions := []pkgv1.Function{{Name: "function-test"}} staleRef := map[string]any{"name": "test-composition-0ld0001"} @@ -4027,8 +4007,8 @@ func TestDefaultDiffProcessor_RenderToStableState_SchemaPlumbing(t *testing.T) { xr := tu.NewResource("example.org/v1", "XLegacy", "test-xr").BuildUComposite() composition := &apiextensionsv1.Composition{ - ObjectMeta: metav1.ObjectMeta{Name: "test-composition"}, - Spec: apiextensionsv1.CompositionSpec{Mode: apiextensionsv1.CompositionModePipeline}, + Name: "test-composition", + Spec: apiextensionsv1.CompositionSpec{Mode: apiextensionsv1.CompositionModePipeline}, } // resolveSchemaAndXRDForRender derives the schema from the XRD's diff --git a/internal/diff/diffprocessor/function_provider_test.go b/internal/diff/diffprocessor/function_provider_test.go index d6504dde..373ea45f 100644 --- a/internal/diff/diffprocessor/function_provider_test.go +++ b/internal/diff/diffprocessor/function_provider_test.go @@ -62,7 +62,7 @@ func TestNewCachedFunctionProvider(t *testing.T) { func TestCachedFunctionProvider_GetFunctionsForComposition_LazyLoading(t *testing.T) { functions := []pkgv1.Function{ { - ObjectMeta: metav1.ObjectMeta{Name: "function-test"}, + Name: "function-test", Spec: pkgv1.FunctionSpec{ PackageSpec: pkgv1.PackageSpec{ Package: "xpkg.io/crossplane/function-go-templating:v0.11.0", @@ -79,7 +79,7 @@ func TestCachedFunctionProvider_GetFunctionsForComposition_LazyLoading(t *testin provider := NewCachedFunctionProvider(fnClient, logger) comp := &apiextensionsv1.Composition{ - ObjectMeta: metav1.ObjectMeta{Name: "test-composition"}, + Name: "test-composition", } fns, err := provider.GetFunctionsForComposition(t.Context(), comp) @@ -101,7 +101,7 @@ func TestCachedFunctionProvider_GetFunctionsForComposition_LazyLoading(t *testin func TestCachedFunctionProvider_GetFunctionsForComposition_CacheHit(t *testing.T) { functions := []pkgv1.Function{ { - ObjectMeta: metav1.ObjectMeta{Name: "function-test"}, + Name: "function-test", Spec: pkgv1.FunctionSpec{ PackageSpec: pkgv1.PackageSpec{ Package: "xpkg.io/test/function:v1.0.0", @@ -122,7 +122,7 @@ func TestCachedFunctionProvider_GetFunctionsForComposition_CacheHit(t *testing.T provider := NewCachedFunctionProvider(fnClient, logger) comp := &apiextensionsv1.Composition{ - ObjectMeta: metav1.ObjectMeta{Name: "test-composition"}, + Name: "test-composition", } // First call should fetch @@ -164,7 +164,7 @@ func TestCachedFunctionProvider_GetFunctionsForComposition_Error(t *testing.T) { provider := NewCachedFunctionProvider(fnClient, logger) comp := &apiextensionsv1.Composition{ - ObjectMeta: metav1.ObjectMeta{Name: "test-composition"}, + Name: "test-composition", } _, err := provider.GetFunctionsForComposition(t.Context(), comp) @@ -187,7 +187,7 @@ func TestCachedFunctionProvider_GetFunctionsForComposition_MultipleCompositions( if comp.Name == "composition-1" { return []pkgv1.Function{ { - ObjectMeta: metav1.ObjectMeta{Name: "function-1"}, + Name: "function-1", Spec: pkgv1.FunctionSpec{ PackageSpec: pkgv1.PackageSpec{ Package: "xpkg.io/test/function-one:v1.0.0", @@ -199,7 +199,7 @@ func TestCachedFunctionProvider_GetFunctionsForComposition_MultipleCompositions( return []pkgv1.Function{ { - ObjectMeta: metav1.ObjectMeta{Name: "function-2"}, + Name: "function-2", Spec: pkgv1.FunctionSpec{ PackageSpec: pkgv1.PackageSpec{ Package: "xpkg.io/test/function-two:v2.0.0", @@ -214,10 +214,10 @@ func TestCachedFunctionProvider_GetFunctionsForComposition_MultipleCompositions( provider := NewCachedFunctionProvider(fnClient, logger) comp1 := &apiextensionsv1.Composition{ - ObjectMeta: metav1.ObjectMeta{Name: "composition-1"}, + Name: "composition-1", } comp2 := &apiextensionsv1.Composition{ - ObjectMeta: metav1.ObjectMeta{Name: "composition-2"}, + Name: "composition-2", } // Fetch for composition 1 @@ -264,7 +264,7 @@ func TestCachedFunctionProvider_GetFunctionsForComposition_SameNameDifferentPipe WithGetFunctionsFromPipeline(func(_ context.Context, comp *apiextensionsv1.Composition) ([]pkgv1.Function, error) { fns := make([]pkgv1.Function, 0, len(comp.Spec.Pipeline)) for _, step := range comp.Spec.Pipeline { - fns = append(fns, pkgv1.Function{ObjectMeta: metav1.ObjectMeta{Name: step.FunctionRef.Name}}) + fns = append(fns, pkgv1.Function{Name: step.FunctionRef.Name}) } return fns, nil @@ -274,7 +274,7 @@ func TestCachedFunctionProvider_GetFunctionsForComposition_SameNameDifferentPipe provider := NewCachedFunctionProvider(fnClient, tu.TestLogger(t, false)) withPipeline := func(fnNames ...string) *apiextensionsv1.Composition { - comp := &apiextensionsv1.Composition{ObjectMeta: metav1.ObjectMeta{Name: "shared-name"}} + comp := &apiextensionsv1.Composition{Name: "shared-name"} for _, n := range fnNames { comp.Spec.Pipeline = append(comp.Spec.Pipeline, apiextensionsv1.PipelineStep{ Step: n, @@ -302,12 +302,12 @@ func TestCachedFunctionProvider_GetFunctionsForComposition_SameNameDifferentPipe func TestImageConfigFunctionProvider(t *testing.T) { fn := func(name, pkg string) pkgv1.Function { return pkgv1.Function{ - ObjectMeta: metav1.ObjectMeta{Name: name}, - Spec: pkgv1.FunctionSpec{PackageSpec: pkgv1.PackageSpec{Package: pkg}}, + Name: name, + Spec: pkgv1.FunctionSpec{PackageSpec: pkgv1.PackageSpec{Package: pkg}}, } } mirror := pkgv1beta1.ImageConfig{ - ObjectMeta: metav1.ObjectMeta{Name: "mirror"}, + Name: "mirror", Spec: pkgv1beta1.ImageConfigSpec{ MatchImages: []pkgv1beta1.ImageMatch{{Prefix: "xpkg.crossplane.io/crossplane-contrib/"}}, RewriteImage: &pkgv1beta1.ImageRewrite{Prefix: "registry.example.com/mirror/"}, @@ -340,7 +340,7 @@ func TestImageConfigFunctionProvider(t *testing.T) { "MissingRewritePrefix": { reason: "A matching ImageConfig with an empty rewrite prefix should fail rather than pull the original image.", ics: []pkgv1beta1.ImageConfig{{ - ObjectMeta: metav1.ObjectMeta{Name: "broken"}, + Name: "broken", Spec: pkgv1beta1.ImageConfigSpec{ MatchImages: []pkgv1beta1.ImageMatch{{Prefix: "xpkg.crossplane.io/"}}, RewriteImage: &pkgv1beta1.ImageRewrite{}, @@ -362,7 +362,7 @@ func TestImageConfigFunctionProvider(t *testing.T) { logger := tu.TestLogger(t, false) provider := NewImageConfigFunctionProvider(NewCachedFunctionProvider(fnClient, logger), tt.ics, logger) - fns, err := provider.GetFunctionsForComposition(t.Context(), &apiextensionsv1.Composition{ObjectMeta: metav1.ObjectMeta{Name: "test-composition"}}) + fns, err := provider.GetFunctionsForComposition(t.Context(), &apiextensionsv1.Composition{Name: "test-composition"}) if gotErr := err != nil; gotErr != tt.wantErr { t.Fatalf("\n%s\nGetFunctionsForComposition(): want error %t, got %v", tt.reason, tt.wantErr, err) } @@ -411,7 +411,7 @@ func TestUpsertEnvPair(t *testing.T) { // provider caches and returns the same Function values). func TestEnvInjectingFunctionProvider(t *testing.T) { newInner := func(anns map[string]string) FunctionProvider { - fn := pkgv1.Function{ObjectMeta: metav1.ObjectMeta{Name: "function-go-templating"}} + fn := pkgv1.Function{Name: "function-go-templating"} if anns != nil { fn.Annotations = anns } @@ -424,7 +424,7 @@ func TestEnvInjectingFunctionProvider(t *testing.T) { return NewCachedFunctionProvider(fnClient, tu.TestLogger(t, false)) } - comp := &apiextensionsv1.Composition{ObjectMeta: metav1.ObjectMeta{Name: "test-composition"}} + comp := &apiextensionsv1.Composition{Name: "test-composition"} envs := map[string]string{EnvMaxRecvMessageSize: "16"} t.Run("injects when annotation absent", func(t *testing.T) { @@ -475,7 +475,7 @@ func TestEnvInjectingFunctionProvider(t *testing.T) { // starts. The composition is fetched once, and no caller's change reaches another's or the cache. // Run it with -race. func TestCachedFunctionProvider_ConcurrentUse(t *testing.T) { - functions := []pkgv1.Function{{ObjectMeta: metav1.ObjectMeta{Name: "function-test", Annotations: map[string]string{}}}} + functions := []pkgv1.Function{{Name: "function-test", Annotations: map[string]string{}}} var fetches atomic.Int32 @@ -487,7 +487,7 @@ func TestCachedFunctionProvider_ConcurrentUse(t *testing.T) { Build() provider := NewCachedFunctionProvider(fnClient, tu.TestLogger(t, false)) - comp := &apiextensionsv1.Composition{ObjectMeta: metav1.ObjectMeta{Name: "test-composition"}} + comp := &apiextensionsv1.Composition{Name: "test-composition"} var wg sync.WaitGroup for i := range 8 { diff --git a/internal/diff/diffprocessor/project_function_provider_test.go b/internal/diff/diffprocessor/project_function_provider_test.go index bdcc5df1..708a276b 100644 --- a/internal/diff/diffprocessor/project_function_provider_test.go +++ b/internal/diff/diffprocessor/project_function_provider_test.go @@ -38,15 +38,15 @@ import ( func testFn(name, pkg string) pkgv1.Function { return pkgv1.Function{ - ObjectMeta: metav1.ObjectMeta{Name: name}, - Spec: pkgv1.FunctionSpec{PackageSpec: pkgv1.PackageSpec{Package: pkg}}, + Name: name, + Spec: pkgv1.FunctionSpec{PackageSpec: pkgv1.PackageSpec{Package: pkg}}, } } func pipelineComp(name string, fnNames ...string) *apiextensionsv1.Composition { comp := &apiextensionsv1.Composition{ - ObjectMeta: metav1.ObjectMeta{Name: name}, - Spec: apiextensionsv1.CompositionSpec{Mode: apiextensionsv1.CompositionModePipeline}, + Name: name, + Spec: apiextensionsv1.CompositionSpec{Mode: apiextensionsv1.CompositionModePipeline}, } for i, fn := range fnNames { comp.Spec.Pipeline = append(comp.Spec.Pipeline, apiextensionsv1.PipelineStep{ @@ -183,8 +183,8 @@ func TestProjectFunctionProvider_GetFunctionsForComposition(t *testing.T) { reason: "A non-pipeline composition is left to the wrapped provider to reject.", project: []pkgv1.Function{testFn("function-a", "xpkg.io/project/function-a:local")}, comp: &apiextensionsv1.Composition{ - ObjectMeta: metav1.ObjectMeta{Name: "comp"}, - Spec: apiextensionsv1.CompositionSpec{Mode: "Resources"}, + Name: "comp", + Spec: apiextensionsv1.CompositionSpec{Mode: "Resources"}, }, want: want{errSub: "unsupported composition Mode"}, }, diff --git a/internal/diff/diffprocessor/render_engine_test.go b/internal/diff/diffprocessor/render_engine_test.go index 06afb662..08653b39 100644 --- a/internal/diff/diffprocessor/render_engine_test.go +++ b/internal/diff/diffprocessor/render_engine_test.go @@ -81,13 +81,13 @@ func minimalRenderInputs() RenderInputs { }, }, Functions: []pkgv1.Function{ - {ObjectMeta: metav1.ObjectMeta{ + { Name: "fn-default", Annotations: map[string]string{ render.AnnotationKeyRuntime: string(render.AnnotationValueRuntimeDevelopment), render.AnnotationKeyRuntimeDevelopmentTarget: "fn-default:9443", }, - }}, + }, }, } } diff --git a/internal/diff/diffprocessor/render_version.go b/internal/diff/diffprocessor/render_version.go index 9c0fcb5e..b88577d0 100644 --- a/internal/diff/diffprocessor/render_version.go +++ b/internal/diff/diffprocessor/render_version.go @@ -160,12 +160,12 @@ func renderImageTag(image string) string { return "" } - i := strings.LastIndex(image, ":") - if i < 0 { + _, after, ok := strings.CutLast(image, ":") + if !ok { return "" } - tag := image[i+1:] + tag := after // A ":" that precedes a "/" is a registry port, not a tag separator. if strings.Contains(tag, "/") { diff --git a/internal/diff/renderer/comp_diff_renderer_test.go b/internal/diff/renderer/comp_diff_renderer_test.go index a1591723..b9725cd4 100644 --- a/internal/diff/renderer/comp_diff_renderer_test.go +++ b/internal/diff/renderer/comp_diff_renderer_test.go @@ -36,7 +36,7 @@ func TestDefaultCompDiffRenderer_RenderCompDiff(t *testing.T) { Compositions: []dt.CompositionDiff{{ Name: "test-comp", AffectedResources: dt.AffectedResourcesSummary{Total: 1, Unchanged: 1}, - ImpactAnalysis: []dt.XRImpact{{ObjectReference: corev1.ObjectReference{APIVersion: "example.org/v1", Kind: "XResource", Name: "xr-1"}, Status: dt.XRStatusUnchanged}}, + ImpactAnalysis: []dt.XRImpact{{APIVersion: "example.org/v1", Kind: "XResource", Name: "xr-1", Status: dt.XRStatusUnchanged}}, }}, }, colorize: false, @@ -63,10 +63,10 @@ func TestDefaultCompDiffRenderer_RenderCompDiff(t *testing.T) { Name: "test-comp", AffectedResources: dt.AffectedResourcesSummary{Total: 1, FilteredByPolicy: 1}, ImpactAnalysis: []dt.XRImpact{{ - ObjectReference: corev1.ObjectReference{APIVersion: "example.org/v1", Kind: "XR", Name: "manual-xr", Namespace: "ns"}, - Status: dt.XRStatusFiltered, - FilterReason: dt.FilterReasonManualPolicy, - FilterDetail: "compositionRevisionRef: test-comp-abc1234", + APIVersion: "example.org/v1", Kind: "XR", Name: "manual-xr", Namespace: "ns", + Status: dt.XRStatusFiltered, + FilterReason: dt.FilterReasonManualPolicy, + FilterDetail: "compositionRevisionRef: test-comp-abc1234", }}, }}, }, @@ -91,11 +91,11 @@ func TestDefaultCompDiffRenderer_RenderCompDiff(t *testing.T) { AffectedResources: dt.AffectedResourcesSummary{Total: 2, Unchanged: 1, FilteredBySelector: 1}, ImpactAnalysis: []dt.XRImpact{ { - ObjectReference: corev1.ObjectReference{APIVersion: "example.org/v1", Kind: "XR", Name: "selector-xr", Namespace: "ns"}, - Status: dt.XRStatusFiltered, - FilterReason: dt.FilterReasonRevisionSelectorMismatch, + APIVersion: "example.org/v1", Kind: "XR", Name: "selector-xr", Namespace: "ns", + Status: dt.XRStatusFiltered, + FilterReason: dt.FilterReasonRevisionSelectorMismatch, }, - {ObjectReference: corev1.ObjectReference{APIVersion: "example.org/v1", Kind: "XR", Name: "xr-1", Namespace: "ns"}, Status: dt.XRStatusUnchanged}, + {APIVersion: "example.org/v1", Kind: "XR", Name: "xr-1", Namespace: "ns", Status: dt.XRStatusUnchanged}, }, }}, }, @@ -191,7 +191,7 @@ func TestDefaultCompDiffRenderer_RenderCompDiff(t *testing.T) { Name: "test-comp", CompositionDiff: &dt.ResourceDiff{DiffType: dt.DiffTypeModified, ResourceName: "test-comp", Gvk: schema.GroupVersionKind{Group: "apiextensions.crossplane.io", Version: "v1", Kind: "Composition"}}, AffectedResources: dt.AffectedResourcesSummary{Total: 1, Unchanged: 1}, - ImpactAnalysis: []dt.XRImpact{{ObjectReference: corev1.ObjectReference{APIVersion: "example.org/v1", Kind: "XResource", Name: "xr-1"}, Status: dt.XRStatusUnchanged}}, + ImpactAnalysis: []dt.XRImpact{{APIVersion: "example.org/v1", Kind: "XResource", Name: "xr-1", Status: dt.XRStatusUnchanged}}, }}, }, colorize: false, @@ -232,15 +232,15 @@ func TestDefaultCompDiffRenderer_RenderCompDiff(t *testing.T) { AffectedResources: dt.AffectedResourcesSummary{Total: 3, FilteredByPolicy: 1, FilteredByDeletion: 1}, ImpactAnalysis: []dt.XRImpact{ { - ObjectReference: corev1.ObjectReference{APIVersion: "example.org/v1", Kind: "XR", Name: "my-manual-xr", Namespace: "default"}, - Status: dt.XRStatusFiltered, - FilterReason: dt.FilterReasonManualPolicy, + APIVersion: "example.org/v1", Kind: "XR", Name: "my-manual-xr", Namespace: "default", + Status: dt.XRStatusFiltered, + FilterReason: dt.FilterReasonManualPolicy, }, { - ObjectReference: corev1.ObjectReference{APIVersion: "example.org/v1", Kind: "XR", Name: "my-deleting-xr", Namespace: "default"}, - Status: dt.XRStatusFiltered, - FilterReason: dt.FilterReasonDeleting, - FilterDetail: "deletionTimestamp: 2026-09-07T11:25:03Z", + APIVersion: "example.org/v1", Kind: "XR", Name: "my-deleting-xr", Namespace: "default", + Status: dt.XRStatusFiltered, + FilterReason: dt.FilterReasonDeleting, + FilterDetail: "deletionTimestamp: 2026-09-07T11:25:03Z", }, }, }}, @@ -287,10 +287,10 @@ func TestDefaultCompDiffRenderer_RenderCompDiff(t *testing.T) { RevisionImpact: dt.RevisionImpact{ChangeScope: "metadata", CreatesRevision: true}, AffectedResources: dt.AffectedResourcesSummary{Total: 1, FilteredByDeletion: 1}, ImpactAnalysis: []dt.XRImpact{{ - ObjectReference: corev1.ObjectReference{APIVersion: "example.org/v1", Kind: "XR", Name: "my-deleting-xr", Namespace: "default"}, - Status: dt.XRStatusFiltered, - FilterReason: dt.FilterReasonDeleting, - FilterDetail: "deletionTimestamp: 2026-09-07T11:25:03Z", + APIVersion: "example.org/v1", Kind: "XR", Name: "my-deleting-xr", Namespace: "default", + Status: dt.XRStatusFiltered, + FilterReason: dt.FilterReasonDeleting, + FilterDetail: "deletionTimestamp: 2026-09-07T11:25:03Z", }}, }}, }, @@ -467,22 +467,22 @@ func TestXRStatusFiltered_TextRenderer(t *testing.T) { AffectedResources: dt.AffectedResourcesSummary{Total: 3, FilteredByPolicy: 1, FilteredBySelector: 1, FilteredByDeletion: 1}, ImpactAnalysis: []dt.XRImpact{ { - ObjectReference: corev1.ObjectReference{APIVersion: "example.org/v1", Kind: "XR", Name: "manual-xr", Namespace: "ns"}, - Status: dt.XRStatusFiltered, - FilterReason: dt.FilterReasonManualPolicy, - FilterDetail: "compositionRevisionRef: test-comp-abc1234", + APIVersion: "example.org/v1", Kind: "XR", Name: "manual-xr", Namespace: "ns", + Status: dt.XRStatusFiltered, + FilterReason: dt.FilterReasonManualPolicy, + FilterDetail: "compositionRevisionRef: test-comp-abc1234", }, { - ObjectReference: corev1.ObjectReference{APIVersion: "example.org/v1", Kind: "XR", Name: "selector-xr", Namespace: "ns"}, - Status: dt.XRStatusFiltered, - FilterReason: dt.FilterReasonRevisionSelectorMismatch, - FilterDetail: "compositionRevisionSelector {version: 0.0.1} does not match composition labels {version: 0.0.2}", + APIVersion: "example.org/v1", Kind: "XR", Name: "selector-xr", Namespace: "ns", + Status: dt.XRStatusFiltered, + FilterReason: dt.FilterReasonRevisionSelectorMismatch, + FilterDetail: "compositionRevisionSelector {version: 0.0.1} does not match composition labels {version: 0.0.2}", }, { - ObjectReference: corev1.ObjectReference{APIVersion: "example.org/v1", Kind: "XR", Name: "deleting-xr", Namespace: "ns"}, - Status: dt.XRStatusFiltered, - FilterReason: dt.FilterReasonDeleting, - FilterDetail: "deletionTimestamp: 2026-09-07T11:25:03Z", + APIVersion: "example.org/v1", Kind: "XR", Name: "deleting-xr", Namespace: "ns", + Status: dt.XRStatusFiltered, + FilterReason: dt.FilterReasonDeleting, + FilterDetail: "deletionTimestamp: 2026-09-07T11:25:03Z", }, }, } @@ -749,8 +749,8 @@ func TestRenderCompDiff_RevisionImpactLine(t *testing.T) { RevisionImpact: impact, AffectedResources: dt.AffectedResourcesSummary{Total: 1, Unchanged: 1}, ImpactAnalysis: []dt.XRImpact{{ - ObjectReference: corev1.ObjectReference{Kind: "XBucket", Name: "test-xr"}, - Status: dt.XRStatusUnchanged, + Kind: "XBucket", Name: "test-xr", + Status: dt.XRStatusUnchanged, }}, }, wantCount: 1, diff --git a/internal/diff/renderer/dry_run_warnings_test.go b/internal/diff/renderer/dry_run_warnings_test.go index 4a834a68..6575bdc2 100644 --- a/internal/diff/renderer/dry_run_warnings_test.go +++ b/internal/diff/renderer/dry_run_warnings_test.go @@ -63,9 +63,9 @@ func TestRenderers_EmitDryRunWarnings(t *testing.T) { Compositions: []dt.CompositionDiff{{ Name: "xrs.example.org", ImpactAnalysis: []dt.XRImpact{ - {ObjectReference: corev1.ObjectReference{Kind: "XR", Name: "one"}, Status: dt.XRStatusChanged, Diffs: diffMap(first)}, - {ObjectReference: corev1.ObjectReference{Kind: "XR", Name: "two"}, Status: dt.XRStatusChanged, Diffs: diffMap(second)}, - {ObjectReference: corev1.ObjectReference{Kind: "XR", Name: "broken"}, Status: dt.XRStatusError}, + {Kind: "XR", Name: "one", Status: dt.XRStatusChanged, Diffs: diffMap(first)}, + {Kind: "XR", Name: "two", Status: dt.XRStatusChanged, Diffs: diffMap(second)}, + {Kind: "XR", Name: "broken", Status: dt.XRStatusError}, }, }}, Warnings: []dt.OutputWarning{raised}, diff --git a/internal/diff/testutils/mock_builder.go b/internal/diff/testutils/mock_builder.go index aef8dbc0..589c913b 100644 --- a/internal/diff/testutils/mock_builder.go +++ b/internal/diff/testutils/mock_builder.go @@ -1510,13 +1510,9 @@ type CRDBuilder struct { func NewCRD(name, group, kind string) *CRDBuilder { return &CRDBuilder{ crd: &extv1.CustomResourceDefinition{ - TypeMeta: metav1.TypeMeta{ - Kind: "CustomResourceDefinition", - APIVersion: "apiextensions.k8s.io/v1", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: name, - }, + Kind: "CustomResourceDefinition", + APIVersion: "apiextensions.k8s.io/v1", + Name: name, Spec: extv1.CustomResourceDefinitionSpec{ Group: group, Names: extv1.CustomResourceDefinitionNames{ @@ -1668,13 +1664,9 @@ type XRDBuilder struct { func NewXRD(name, group, kind string) *XRDBuilder { return &XRDBuilder{ xrd: &xpextv1.CompositeResourceDefinition{ - TypeMeta: metav1.TypeMeta{ - Kind: "CompositeResourceDefinition", - APIVersion: "apiextensions.crossplane.io/v1", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: name, - }, + Kind: "CompositeResourceDefinition", + APIVersion: "apiextensions.crossplane.io/v1", + Name: name, Spec: xpextv1.CompositeResourceDefinitionSpec{ Group: group, Names: extv1.CustomResourceDefinitionNames{ @@ -1781,14 +1773,10 @@ type CompositionBuilder struct { func NewComposition(name string) *CompositionBuilder { return &CompositionBuilder{ composition: &xpextv1.Composition{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "apiextensions.crossplane.io/v1", - Kind: "Composition", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: name, - }, - Spec: xpextv1.CompositionSpec{}, + APIVersion: "apiextensions.crossplane.io/v1", + Kind: "Composition", + Name: name, + Spec: xpextv1.CompositionSpec{}, }, } } diff --git a/internal/kube/restmapper_test.go b/internal/kube/restmapper_test.go index 1afa7d28..674c4998 100644 --- a/internal/kube/restmapper_test.go +++ b/internal/kube/restmapper_test.go @@ -36,11 +36,11 @@ func newDiscoveryServer(t *testing.T) *httptest.Server { objs := map[string]any{ "/api": &metav1.APIVersions{ - TypeMeta: metav1.TypeMeta{Kind: "APIVersions"}, + Kind: "APIVersions", Versions: []string{"v1"}, }, "/api/v1": &metav1.APIResourceList{ - TypeMeta: metav1.TypeMeta{Kind: "APIResourceList", APIVersion: "v1"}, + Kind: "APIResourceList", APIVersion: "v1", GroupVersion: "v1", APIResources: []metav1.APIResource{{ Name: "pods", @@ -51,7 +51,7 @@ func newDiscoveryServer(t *testing.T) *httptest.Server { ShortNames: []string{"po"}, }}, }, - "/apis": &metav1.APIGroupList{TypeMeta: metav1.TypeMeta{Kind: "APIGroupList"}}, + "/apis": &metav1.APIGroupList{Kind: "APIGroupList"}, } srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { diff --git a/internal/project/build.go b/internal/project/build.go index 5e66a998..f22f28a8 100644 --- a/internal/project/build.go +++ b/internal/project/build.go @@ -208,10 +208,8 @@ func (b *Builder) Build(ctx context.Context, project *devv1alpha1.Project, proje // Scaffold a configuration based on the metadata in the project. cfg := &xpmetav1.Configuration{ - TypeMeta: metav1.TypeMeta{ - APIVersion: xpmetav1.SchemeGroupVersion.String(), - Kind: xpmetav1.ConfigurationKind, - }, + APIVersion: xpmetav1.SchemeGroupVersion.String(), + Kind: xpmetav1.ConfigurationKind, ObjectMeta: cfgMetaFromProject(project, o.extraAnnotations), Spec: xpmetav1.ConfigurationSpec{ MetaSpec: xpmetav1.MetaSpec{ @@ -455,10 +453,8 @@ func (b *Builder) buildFunctions(ctx context.Context, projectFS afero.Fs, projec func (b *Builder) buildFunction(ctx context.Context, projectFS afero.Fs, project *devv1alpha1.Project, fn devv1alpha1.Function, basePath string, extraAnnotations map[string]string) ([]v1.Image, error) { fnName := fn.Name() meta := &xpmetav1.Function{ - TypeMeta: metav1.TypeMeta{ - APIVersion: xpmetav1.SchemeGroupVersion.String(), - Kind: xpmetav1.FunctionKind, - }, + APIVersion: xpmetav1.SchemeGroupVersion.String(), + Kind: xpmetav1.FunctionKind, ObjectMeta: fnMetaFromProject(project, fnName, extraAnnotations), Spec: xpmetav1.FunctionSpec{ MetaSpec: xpmetav1.MetaSpec{ diff --git a/internal/project/build_test.go b/internal/project/build_test.go index d793a83c..31a14a32 100644 --- a/internal/project/build_test.go +++ b/internal/project/build_test.go @@ -155,9 +155,7 @@ func TestBuilderBuild(t *testing.T) { writeProject(t, projFS, tc.apis, tc.functions) proj := &devv1alpha1.Project{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-project", - }, + Name: "test-project", Spec: devv1alpha1.ProjectSpec{ ProjectPackageMetadata: devv1alpha1.ProjectPackageMetadata{ Maintainer: "Maintainer ", @@ -250,9 +248,7 @@ func TestBuilderDependsOn(t *testing.T) { }, } proj := &devv1alpha1.Project{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-project", - }, + Name: "test-project", Spec: devv1alpha1.ProjectSpec{ Repository: "xpkg.crossplane.io/example/test", Architectures: []string{"amd64", "arm64"}, @@ -309,8 +305,8 @@ func TestBuilderZeroConcurrency(t *testing.T) { []string{"fn-one"}, ) proj := &devv1alpha1.Project{ - ObjectMeta: metav1.ObjectMeta{Name: "test-project"}, - Spec: devv1alpha1.ProjectSpec{Repository: "xpkg.crossplane.io/example/test"}, + Name: "test-project", + Spec: devv1alpha1.ProjectSpec{Repository: "xpkg.crossplane.io/example/test"}, } proj.Default() @@ -413,8 +409,8 @@ func TestResolveFunctions(t *testing.T) { } proj := &devv1alpha1.Project{ - ObjectMeta: metav1.ObjectMeta{Name: "p"}, - Spec: tc.spec, + Name: "p", + Spec: tc.spec, } proj.Spec.Repository = "xpkg.crossplane.io/example/test" proj.Default() @@ -445,7 +441,7 @@ func TestBuilderBuildExplicitFunctions(t *testing.T) { ) proj := &devv1alpha1.Project{ - ObjectMeta: metav1.ObjectMeta{Name: "test-project"}, + Name: "test-project", Spec: devv1alpha1.ProjectSpec{ Repository: "xpkg.crossplane.io/example/test", Functions: []devv1alpha1.Function{{ @@ -506,7 +502,7 @@ func TestBuilderBuildTarballFunction(t *testing.T) { } proj := &devv1alpha1.Project{ - ObjectMeta: metav1.ObjectMeta{Name: "test-project"}, + Name: "test-project", Spec: devv1alpha1.ProjectSpec{ Repository: "xpkg.crossplane.io/example/test", Architectures: []string{"amd64", "arm64"}, diff --git a/internal/project/controlplane/controlplane.go b/internal/project/controlplane/controlplane.go index 75225f4a..4ac093c1 100644 --- a/internal/project/controlplane/controlplane.go +++ b/internal/project/controlplane/controlplane.go @@ -177,9 +177,7 @@ func (l *localDevControlPlane) Sideload(ctx context.Context, imgMap project.Imag rewrite := path.Join(l.registryHostname, tag.RepositoryStr()) imgcfg := &pkgv1beta1.ImageConfig{ - ObjectMeta: metav1.ObjectMeta{ - Name: "local-registry", - }, + Name: "local-registry", Spec: pkgv1beta1.ImageConfigSpec{ MatchImages: []pkgv1beta1.ImageMatch{{ Type: pkgv1beta1.Prefix, @@ -300,9 +298,7 @@ func EnsureLocalDevControlPlane(ctx context.Context, opts ...Option) (DevControl // Create the crossplane namespace. ns := &corev1.Namespace{ - ObjectMeta: metav1.ObjectMeta{ - Name: crossplaneNamespace, - }, + Name: crossplaneNamespace, } if err := cl.Create(ctx, ns); err != nil && !kerrors.IsAlreadyExists(err) { return nil, errors.Wrap(err, "failed to create crossplane-system namespace") @@ -462,10 +458,8 @@ func createNewKindCluster(provider *kind.Provider, clusterName, kubeconfigPath s func createKindClusterConfig() *v1alpha4.Cluster { return &v1alpha4.Cluster{ - TypeMeta: v1alpha4.TypeMeta{ - APIVersion: "kind.x-k8s.io/v1alpha4", - Kind: "Cluster", - }, + APIVersion: "kind.x-k8s.io/v1alpha4", + Kind: "Cluster", Nodes: []v1alpha4.Node{{ Role: v1alpha4.ControlPlaneRole, }}, @@ -609,10 +603,8 @@ func ensureLocalRegistryCertificate(ctx context.Context, cl client.Client, hostn } cm := &corev1.ConfigMap{ - ObjectMeta: metav1.ObjectMeta{ - Name: "local-registry-cert", - Namespace: crossplaneNamespace, - }, + Name: "local-registry-cert", + Namespace: crossplaneNamespace, BinaryData: map[string][]byte{ certs.SecretKeyCACert: s.Data[certs.SecretKeyCACert], }, @@ -634,10 +626,8 @@ func configureContainerdLocalRegistry(ctx context.Context, cl client.Client, reg cmd += fmt.Sprintf("&& echo '%s' > /containerd-certs/%s:5000/ca.crt", caCert, regName) cmd += fmt.Sprintf("&& echo '%s' > /containerd-certs/%s:5000/hosts.toml", hostsToml, regName) j := &batchv1.Job{ - ObjectMeta: metav1.ObjectMeta{ - Name: "configure-kind-registry", - Namespace: "default", - }, + Name: "configure-kind-registry", + Namespace: "default", Spec: batchv1.JobSpec{ Template: corev1.PodTemplateSpec{ Spec: corev1.PodSpec{ @@ -653,10 +643,8 @@ func configureContainerdLocalRegistry(ctx context.Context, cl client.Client, reg }}, Volumes: []corev1.Volume{{ Name: "containerd-certs", - VolumeSource: corev1.VolumeSource{ - HostPath: &corev1.HostPathVolumeSource{ - Path: "/etc/containerd/certs.d", - }, + HostPath: &corev1.HostPathVolumeSource{ + Path: "/etc/containerd/certs.d", }, }}, }, diff --git a/internal/project/image.go b/internal/project/image.go index bc517b78..d78e5b73 100644 --- a/internal/project/image.go +++ b/internal/project/image.go @@ -113,14 +113,12 @@ func BuildIndex(imgs ...v1.Image) (v1.ImageIndex, []v1.Image, error) { } adds = append(adds, mutate.IndexAddendum{ - Add: aimg, - Descriptor: v1.Descriptor{ - MediaType: mt, - Platform: &v1.Platform{ - Architecture: conf.Architecture, - OS: conf.OS, - OSVersion: conf.OSVersion, - }, + Add: aimg, + MediaType: mt, + Platform: &v1.Platform{ + Architecture: conf.Architecture, + OS: conf.OS, + OSVersion: conf.OSVersion, }, }) } diff --git a/internal/project/install.go b/internal/project/install.go index eee64436..e8e2e85f 100644 --- a/internal/project/install.go +++ b/internal/project/install.go @@ -46,13 +46,9 @@ import ( func InstallConfiguration(ctx context.Context, cl client.Client, cfgName string, tag name.Tag, logger logging.Logger) error { pkgSource := tag.String() cfg := &xpkgv1.Configuration{ - TypeMeta: metav1.TypeMeta{ - APIVersion: xpkgv1.SchemeGroupVersion.String(), - Kind: xpkgv1.ConfigurationKind, - }, - ObjectMeta: metav1.ObjectMeta{ - Name: cfgName, - }, + APIVersion: xpkgv1.SchemeGroupVersion.String(), + Kind: xpkgv1.ConfigurationKind, + Name: cfgName, Spec: xpkgv1.ConfigurationSpec{ PackageSpec: xpkgv1.PackageSpec{ Package: pkgSource, diff --git a/internal/project/install_test.go b/internal/project/install_test.go index b4bef501..d047c616 100644 --- a/internal/project/install_test.go +++ b/internal/project/install_test.go @@ -52,15 +52,11 @@ func TestApplyResources(t *testing.T) { configMapJSON := func(name string) []byte { cm := &corev1.ConfigMap{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "v1", - Kind: "ConfigMap", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: name, - Namespace: "default", - }, - Data: map[string]string{"key": "value"}, + APIVersion: "v1", + Kind: "ConfigMap", + Name: name, + Namespace: "default", + Data: map[string]string{"key": "value"}, } bs, err := json.Marshal(cm) if err != nil { diff --git a/internal/project/projectfile/projectfile_test.go b/internal/project/projectfile/projectfile_test.go index 431051d4..17867220 100644 --- a/internal/project/projectfile/projectfile_test.go +++ b/internal/project/projectfile/projectfile_test.go @@ -315,13 +315,9 @@ func TestUpdate(t *testing.T) { t.Parallel() proj := &v1alpha1.Project{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "dev.crossplane.io/v1alpha1", - Kind: "Project", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "my-project", - }, + APIVersion: "dev.crossplane.io/v1alpha1", + Kind: "Project", + Name: "my-project", Spec: v1alpha1.ProjectSpec{ Repository: "xpkg.crossplane.io/foo/bar", }, diff --git a/internal/project/render.go b/internal/project/render.go index f0061ad8..af605e5a 100644 --- a/internal/project/render.go +++ b/internal/project/render.go @@ -54,9 +54,7 @@ func LoadFunctionDependencies(resolver Resolver, proj *devv1alpha1.Project) ([]p fns := make([]pkgv1.Function, 0, len(refs)) for _, resolved := range refs { f := pkgv1.Function{ - ObjectMeta: metav1.ObjectMeta{ - Name: xpkg.ToDNSLabel(resolved.Context().RepositoryStr()), - }, + Name: xpkg.ToDNSLabel(resolved.Context().RepositoryStr()), Spec: pkgv1.FunctionSpec{ PackageSpec: pkgv1.PackageSpec{ Package: resolved.Name(), @@ -138,9 +136,7 @@ func EmbeddedFunctionsToDaemon(ctx context.Context, imageMap ImageTagMap) ([]pkg } fns = append(fns, pkgv1.Function{ - ObjectMeta: metav1.ObjectMeta{ - Name: xpkg.ToDNSLabel(tag.Context().RepositoryStr()), - }, + Name: xpkg.ToDNSLabel(tag.Context().RepositoryStr()), Spec: pkgv1.FunctionSpec{ PackageSpec: pkgv1.PackageSpec{ Package: tag.Name(), diff --git a/internal/schemas/generator/go.go b/internal/schemas/generator/go.go index c8a7e312..8ea21abf 100644 --- a/internal/schemas/generator/go.go +++ b/internal/schemas/generator/go.go @@ -706,12 +706,12 @@ func goRenamePropertyTypes(baseName string, props map[string]spec.Schema) { } func goFixName(name string) string { - lastDot := strings.LastIndex(name, ".") - if lastDot == -1 { + before, _, ok := strings.CutLast(name, ".") + if !ok { return codegen.ToCamelCaseWithInitialisms(name) } genName := codegen.SchemaNameToTypeName(name) - prefix := codegen.SchemaNameToTypeName(name[:lastDot]) + prefix := codegen.SchemaNameToTypeName(before) return codegen.ToCamelCaseWithInitialisms(strings.TrimPrefix(genName, prefix)) } @@ -921,11 +921,11 @@ func goReferenceK8sTypesPropertiesWithMetaPath(props map[string]spec.Schema, use } func tryReplaceK8sTypeWithMetaPath(schema *spec.Schema, ref string, useCorePath, useRealMeta bool) { - lastDot := strings.LastIndex(ref, ".") - if lastDot == -1 { + _, after, ok := strings.CutLast(ref, ".") + if !ok { return } - t := ref[lastDot+1:] + t := after // useRealMeta always resolves meta.v1 to the real apimachinery package, // since client.Object needs its exact types, not a similar mirror. diff --git a/internal/schemas/generator/json_test.go b/internal/schemas/generator/json_test.go index c8071641..0125a4ea 100644 --- a/internal/schemas/generator/json_test.go +++ b/internal/schemas/generator/json_test.go @@ -111,16 +111,14 @@ func TestRewriteComponentRefs(t *testing.T) { cRef := func(n string) spec.Ref { return spec.MustCreateRef("#/components/schemas/" + n) } s := &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Properties: map[string]spec.Schema{ - "a": {SchemaProps: spec.SchemaProps{Ref: cRef("A")}}, - }, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{SchemaProps: spec.SchemaProps{Ref: cRef("B")}}, - }, - AllOf: []spec.Schema{{SchemaProps: spec.SchemaProps{Ref: cRef("C")}}}, - Not: &spec.Schema{SchemaProps: spec.SchemaProps{Ref: cRef("D")}}, + Properties: map[string]spec.Schema{ + "a": {SchemaProps: spec.SchemaProps{Ref: cRef("A")}}, + }, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{Ref: cRef("B")}, }, + AllOf: []spec.Schema{{Ref: cRef("C")}}, + Not: &spec.Schema{Ref: cRef("D")}, } rewriteComponentRefs(s) @@ -141,7 +139,7 @@ func TestRewriteComponentRefs(t *testing.T) { func TestCRDsToJSONSchemasRewritesRefs(t *testing.T) { crd := &extv1.CustomResourceDefinition{ - ObjectMeta: metav1.ObjectMeta{Name: "widgets.example.org"}, + Name: "widgets.example.org", Spec: extv1.CustomResourceDefinitionSpec{ Group: "example.org", Names: extv1.CustomResourceDefinitionNames{ diff --git a/internal/schemas/generator/rust_test.go b/internal/schemas/generator/rust_test.go index 18341570..a1d8b646 100644 --- a/internal/schemas/generator/rust_test.go +++ b/internal/schemas/generator/rust_test.go @@ -44,33 +44,33 @@ func rustTestSchema(t spec.Schema, description string) spec.Schema { } func rustTestScalar(typ, format string) spec.Schema { - return spec.Schema{SchemaProps: spec.SchemaProps{Type: spec.StringOrArray{typ}, Format: format}} + return spec.Schema{Type: spec.StringOrArray{typ}, Format: format} } func rustTestObject(props map[string]spec.Schema) spec.Schema { - return spec.Schema{SchemaProps: spec.SchemaProps{Type: spec.StringOrArray{"object"}, Properties: props}} + return spec.Schema{Type: spec.StringOrArray{"object"}, Properties: props} } func rustTestArray(items spec.Schema) spec.Schema { - return spec.Schema{SchemaProps: spec.SchemaProps{ + return spec.Schema{ Type: spec.StringOrArray{"array"}, Items: &spec.SchemaOrArray{Schema: &items}, - }} + } } func rustTestMap(values spec.Schema) spec.Schema { - return spec.Schema{SchemaProps: spec.SchemaProps{ + return spec.Schema{ Type: spec.StringOrArray{"object"}, AdditionalProperties: &spec.SchemaOrBool{Allows: true, Schema: &values}, - }} + } } // rustTestRef builds the allOf-wrapped reference CRD and Kubernetes documents // use, which is also the shape a plain $ref has to survive. func rustTestRef(schema string) spec.Schema { - return spec.Schema{SchemaProps: spec.SchemaProps{ - AllOf: []spec.Schema{{SchemaProps: spec.SchemaProps{Ref: spec.MustCreateRef("#/components/schemas/" + schema)}}}, - }} + return spec.Schema{ + AllOf: []spec.Schema{{Ref: spec.MustCreateRef("#/components/schemas/" + schema)}}, + } } func rustTestEnum(values ...string) spec.Schema { @@ -89,7 +89,7 @@ func rustTestDefault(s spec.Schema, def string) spec.Schema { // rustTestAnyOf builds an inline choice of scalars, which is what a CRD's // x-kubernetes-int-or-string is once converted to OpenAPI. func rustTestAnyOf(variants ...spec.Schema) spec.Schema { - return spec.Schema{SchemaProps: spec.SchemaProps{AnyOf: variants}} + return spec.Schema{AnyOf: variants} } // rustTestEmit renders the file of the named schema, as the generator would diff --git a/internal/simulate/report_test.go b/internal/simulate/report_test.go index 241ee7b3..9e9b150c 100644 --- a/internal/simulate/report_test.go +++ b/internal/simulate/report_test.go @@ -104,8 +104,8 @@ func TestFromCompReport(t *testing.T) { compNoOp := &plan.ResourcePlan{APIVersion: compPlan.APIVersion, Kind: compPlan.Kind, Name: compPlan.Name, Action: plan.ActionNoOp} filtered := func(name string, reason dt.FilterReason, detail string) dt.XRImpact { return dt.XRImpact{ - ObjectReference: corev1.ObjectReference{APIVersion: "example.org/v1", Kind: "XNetwork", Name: name}, - Status: dt.XRStatusFiltered, FilterReason: reason, FilterDetail: detail, + APIVersion: "example.org/v1", Kind: "XNetwork", Name: name, + Status: dt.XRStatusFiltered, FilterReason: reason, FilterDetail: detail, } } named := func(name string) plan.ResourceRef { diff --git a/internal/simulate/result_test.go b/internal/simulate/result_test.go index 8da19d12..669ecf89 100644 --- a/internal/simulate/result_test.go +++ b/internal/simulate/result_test.go @@ -31,21 +31,19 @@ func TestRenderPlanGrouped(t *testing.T) { xr := plan.ResourceRef{APIVersion: "example.org/v1", Kind: "XNetwork", Name: "prod-network"} pinned := plan.ResourceRef{APIVersion: "example.org/v1", Kind: "XNetwork", Name: "staging-network"} r := Result{ - Result: plan.Result{ - Summary: plan.Summary{Update: 1, Destroy: 1, NoOp: 1}, - Plans: []*plan.ResourcePlan{ - // The XR's own no-op plan is not printed. - {APIVersion: xr.APIVersion, Kind: xr.Kind, Name: xr.Name, Action: plan.ActionNoOp, Composite: &xr}, - { - APIVersion: "ec2.aws.upbound.io/v1beta1", Kind: "SecurityGroupRule", Name: "prod-network-ssh", - Action: plan.ActionUpdate, Composite: &xr, - Changes: []plan.FieldChange{{Path: "spec.forProvider.fromPort", Actual: &plan.Value{Value: 22}, Planned: &plan.Value{Value: 2222}}}, - }, - { - APIVersion: "ec2.aws.upbound.io/v1beta1", Kind: "Route", Name: "prod-network-default", - Action: plan.ActionDelete, Composite: &xr, - Changes: plan.FieldChanges(map[string]any{"spec": map[string]any{"region": "us-west-1"}}, nil), - }, + Summary: plan.Summary{Update: 1, Destroy: 1, NoOp: 1}, + Plans: []*plan.ResourcePlan{ + // The XR's own no-op plan is not printed. + {APIVersion: xr.APIVersion, Kind: xr.Kind, Name: xr.Name, Action: plan.ActionNoOp, Composite: &xr}, + { + APIVersion: "ec2.aws.upbound.io/v1beta1", Kind: "SecurityGroupRule", Name: "prod-network-ssh", + Action: plan.ActionUpdate, Composite: &xr, + Changes: []plan.FieldChange{{Path: "spec.forProvider.fromPort", Actual: &plan.Value{Value: 22}, Planned: &plan.Value{Value: 2222}}}, + }, + { + APIVersion: "ec2.aws.upbound.io/v1beta1", Kind: "Route", Name: "prod-network-default", + Action: plan.ActionDelete, Composite: &xr, + Changes: plan.FieldChanges(map[string]any{"spec": map[string]any{"region": "us-west-1"}}, nil), }, }, Composites: []CompositeResult{ @@ -117,20 +115,18 @@ func TestRenderPlanCompositions(t *testing.T) { unknown := plan.ResourceRef{APIVersion: comp.APIVersion, Kind: comp.Kind, Name: "unknown"} xr := plan.ResourceRef{APIVersion: "example.org/v1", Kind: "XNetwork", Name: "prod-network"} r := Result{ - Result: plan.Result{ - Summary: plan.Summary{Update: 2, NoOp: 2}, - Plans: []*plan.ResourcePlan{ - { - APIVersion: comp.APIVersion, Kind: comp.Kind, Name: comp.Name, Action: plan.ActionUpdate, - Changes: []plan.FieldChange{{Path: "spec.mode", Actual: &plan.Value{Value: "Resources"}, Planned: &plan.Value{Value: "Pipeline"}}}, - }, - {APIVersion: same.APIVersion, Kind: same.Kind, Name: same.Name, Action: plan.ActionNoOp}, - {APIVersion: unknown.APIVersion, Kind: unknown.Kind, Name: unknown.Name, Action: plan.ActionNoOp}, - { - APIVersion: "ec2.aws.upbound.io/v1beta1", Kind: "VPC", Name: "prod-network", - Action: plan.ActionUpdate, Composite: &xr, - Changes: []plan.FieldChange{{Path: "spec.forProvider.region", Actual: &plan.Value{Value: "us-west-1"}, Planned: &plan.Value{Value: "us-east-1"}}}, - }, + Summary: plan.Summary{Update: 2, NoOp: 2}, + Plans: []*plan.ResourcePlan{ + { + APIVersion: comp.APIVersion, Kind: comp.Kind, Name: comp.Name, Action: plan.ActionUpdate, + Changes: []plan.FieldChange{{Path: "spec.mode", Actual: &plan.Value{Value: "Resources"}, Planned: &plan.Value{Value: "Pipeline"}}}, + }, + {APIVersion: same.APIVersion, Kind: same.Kind, Name: same.Name, Action: plan.ActionNoOp}, + {APIVersion: unknown.APIVersion, Kind: unknown.Kind, Name: unknown.Name, Action: plan.ActionNoOp}, + { + APIVersion: "ec2.aws.upbound.io/v1beta1", Kind: "VPC", Name: "prod-network", + Action: plan.ActionUpdate, Composite: &xr, + Changes: []plan.FieldChange{{Path: "spec.forProvider.region", Actual: &plan.Value{Value: "us-west-1"}, Planned: &plan.Value{Value: "us-east-1"}}}, }, }, Composites: []CompositeResult{{Ref: xr, Status: CompositeChanged}}, @@ -189,16 +185,17 @@ func TestRenderJSONProjectFields(t *testing.T) { }}, Warnings: []Warning{{Message: "heads up", Context: map[string]string{"k": "v"}}}, Notes: []string{"a note"}, - } - in.Result = plan.Result{ - FormatVersion: plan.ResultFormatVersion, - Errored: true, - Summary: plan.Summary{Destroy: 1}, - Plans: []*plan.ResourcePlan{{ - APIVersion: "v1", Kind: "ConfigMap", Name: "cm", Action: plan.ActionDelete, Composite: &xr, - Changes: []plan.FieldChange{{Path: "data.k", Actual: &plan.Value{Value: "v"}}}, - DryRun: &plan.Verification{SkipReason: "forbidden", Detail: "no create permission"}, - }}, + + Result: plan.Result{ + FormatVersion: plan.ResultFormatVersion, + Errored: true, + Summary: plan.Summary{Destroy: 1}, + Plans: []*plan.ResourcePlan{{ + APIVersion: "v1", Kind: "ConfigMap", Name: "cm", Action: plan.ActionDelete, Composite: &xr, + Changes: []plan.FieldChange{{Path: "data.k", Actual: &plan.Value{Value: "v"}}}, + DryRun: &plan.Verification{SkipReason: "forbidden", Detail: "no create permission"}, + }}, + }, } var buf bytes.Buffer r, _ := NewRenderer(plan.FormatJSON) diff --git a/internal/simulate/run_test.go b/internal/simulate/run_test.go index ad267985..39a78836 100644 --- a/internal/simulate/run_test.go +++ b/internal/simulate/run_test.go @@ -137,8 +137,8 @@ func TestSimulateScope(t *testing.T) { func TestSimulateProcessorOptions(t *testing.T) { c := &Runner{sel: CompositionFlags{IncludePinned: true, AnalyzeOn: "spec-change"}, Flags: &Flags{ - MaxIterations: 7, - EngineFlags: xprender.EngineFlags{CrossplaneVersion: "v2.3.4", CrossplaneDockerNetwork: "ci"}, + MaxIterations: 7, + CrossplaneVersion: "v2.3.4", CrossplaneDockerNetwork: "ci", MaxNestedDepth: 4, IgnorePaths: []string{"a.b"}, @@ -147,10 +147,10 @@ func TestSimulateProcessorOptions(t *testing.T) { DryRunOn: "existing", }} - creds := []corev1.Secret{{ObjectMeta: metav1.ObjectMeta{Name: "creds"}}} + creds := []corev1.Secret{{Name: "creds"}} cfg := dp.ProcessorConfig{} advisories := dp.NewAdvisoryCollector(nil) - for _, o := range c.processorOptions(advisories, logging.NewNopLogger(), creds, []pkgv1.Function{{ObjectMeta: metav1.ObjectMeta{Name: "fn"}}}, nil, nil) { + for _, o := range c.processorOptions(advisories, logging.NewNopLogger(), creds, []pkgv1.Function{{Name: "fn"}}, nil, nil) { o(&cfg) } if cfg.Advisories != advisories { @@ -240,14 +240,14 @@ func TestSimulateProcessorOptions(t *testing.T) { func TestFunctionProviderFactory(t *testing.T) { ics := []pkgv1beta1.ImageConfig{{ - ObjectMeta: metav1.ObjectMeta{Name: "mirror"}, + Name: "mirror", Spec: pkgv1beta1.ImageConfigSpec{ MatchImages: []pkgv1beta1.ImageMatch{{Prefix: "xpkg.crossplane.io/"}}, RewriteImage: &pkgv1beta1.ImageRewrite{Prefix: "mirror.example.com/"}, }, }} fn := func(name, pkg string) pkgv1.Function { - return pkgv1.Function{ObjectMeta: metav1.ObjectMeta{Name: name}, Spec: pkgv1.FunctionSpec{PackageSpec: pkgv1.PackageSpec{Package: pkg}}} + return pkgv1.Function{Name: name, Spec: pkgv1.FunctionSpec{PackageSpec: pkgv1.PackageSpec{Package: pkg}}} } cluster := fn("fn-cluster", "xpkg.crossplane.io/org/fn-cluster:v1") projFns := []pkgv1.Function{ @@ -257,7 +257,7 @@ func TestFunctionProviderFactory(t *testing.T) { embedded := map[string]name.Digest{"fn-own": {}} comp := &apiextensionsv1.Composition{ - ObjectMeta: metav1.ObjectMeta{Name: "comp"}, + Name: "comp", Spec: apiextensionsv1.CompositionSpec{ Mode: apiextensionsv1.CompositionModePipeline, Pipeline: []apiextensionsv1.PipelineStep{ @@ -917,7 +917,7 @@ func TestProviderSource(t *testing.T) { } func TestSimulateProcessorOptionsDockerNetwork(t *testing.T) { - fns := []pkgv1.Function{{ObjectMeta: metav1.ObjectMeta{Name: "fn", Annotations: map[string]string{xprender.AnnotationKeyRuntimeDockerNetwork: "fn-net"}}}} + fns := []pkgv1.Function{{Name: "fn", Annotations: map[string]string{xprender.AnnotationKeyRuntimeDockerNetwork: "fn-net"}}} cases := map[string]struct { env string args []string diff --git a/internal/simulate/simtest/structured_assertions.go b/internal/simulate/simtest/structured_assertions.go index f59f9cbf..13d759cd 100644 --- a/internal/simulate/simtest/structured_assertions.go +++ b/internal/simulate/simtest/structured_assertions.go @@ -199,8 +199,8 @@ func (f *FieldErrorExpectation) expectation() *Expected { return f.parent.parent // substring. Chain WithWarningContext to pin the machine-readable context pairs. func (e *Expected) WithWarning(messageContains string) *WarningExpectation { w := &WarningExpectation{ - parent: e, - warningMatch: warningMatch{messageContains: messageContains}, + parent: e, + messageContains: messageContains, } e.warnings = append(e.warnings, w) diff --git a/internal/simulate/simtest/structured_assertions_test.go b/internal/simulate/simtest/structured_assertions_test.go index 9462375b..1251fe3e 100644 --- a/internal/simulate/simtest/structured_assertions_test.go +++ b/internal/simulate/simtest/structured_assertions_test.go @@ -82,10 +82,8 @@ func xrResult() simulate.Result { } return simulate.Result{ - Result: plan.Result{ - Summary: plan.Summarize(plans), - Plans: plans, - }, + Summary: plan.Summarize(plans), + Plans: plans, Composites: []simulate.CompositeResult{ {Ref: xrA, Status: simulate.CompositeChanged}, {Ref: xrB, Status: simulate.CompositeUnchanged}, @@ -218,20 +216,18 @@ var ( // composite; comp-b reaches only a composite whose analysis failed. func compResult() simulate.Result { return simulate.Result{ - Result: plan.Result{ - Plans: []*plan.ResourcePlan{ - { - APIVersion: compA.APIVersion, Kind: compA.Kind, Name: compA.Name, Action: plan.ActionUpdate, - Changes: []plan.FieldChange{{Path: "spec.mode", Actual: val("Resources"), Planned: val("Pipeline")}}, - }, - {APIVersion: compB.APIVersion, Kind: compB.Kind, Name: compB.Name, Error: "cannot convert composition"}, - { - APIVersion: "example.org/v1", Kind: "XDownstream", Name: "xr-1-abc12", Namespace: "default", Action: plan.ActionUpdate, Composite: &xr1, - Changes: []plan.FieldChange{{Path: "spec.forProvider.configData", Actual: val("old"), Planned: val("new-value-42")}}, - Before: downstreamObject("old"), - After: downstreamObject("new-value-42"), - DryRun: &plan.Verification{SkipReason: "not-found", Detail: "the server could not find it"}, - }, + Plans: []*plan.ResourcePlan{ + { + APIVersion: compA.APIVersion, Kind: compA.Kind, Name: compA.Name, Action: plan.ActionUpdate, + Changes: []plan.FieldChange{{Path: "spec.mode", Actual: val("Resources"), Planned: val("Pipeline")}}, + }, + {APIVersion: compB.APIVersion, Kind: compB.Kind, Name: compB.Name, Error: "cannot convert composition"}, + { + APIVersion: "example.org/v1", Kind: "XDownstream", Name: "xr-1-abc12", Namespace: "default", Action: plan.ActionUpdate, Composite: &xr1, + Changes: []plan.FieldChange{{Path: "spec.forProvider.configData", Actual: val("old"), Planned: val("new-value-42")}}, + Before: downstreamObject("old"), + After: downstreamObject("new-value-42"), + DryRun: &plan.Verification{SkipReason: "not-found", Detail: "the server could not find it"}, }, }, Compositions: []simulate.CompositionResult{ diff --git a/internal/simulate/xrplan_test.go b/internal/simulate/xrplan_test.go index 546abda7..e95ffd3d 100644 --- a/internal/simulate/xrplan_test.go +++ b/internal/simulate/xrplan_test.go @@ -71,8 +71,8 @@ func TestXRPlanner(t *testing.T) { rm.Add(vpcGVK, meta.RESTScopeRoot) pc := &funcPlanClient{ - fakePlanClient: fakePlanClient{rsp: &diffv1alpha1.PlanResponse{Action: diffv1alpha1.Action_ACTION_CREATE}}, - fail: map[string]bool{"bad-a": true, "bad-b": true}, + rsp: &diffv1alpha1.PlanResponse{Action: diffv1alpha1.Action_ACTION_CREATE}, + fail: map[string]bool{"bad-a": true, "bad-b": true}, } planner := NewPlanner(fake.NewClientBuilder().WithScheme(s).Build(), rm, noCRDs(t), "default", &fakeRouter{client: pc}, time.Second) @@ -236,7 +236,7 @@ func TestXRPlannerRepeatedKey(t *testing.T) { rm := meta.NewDefaultRESTMapper([]schema.GroupVersion{vpcGVK.GroupVersion()}) rm.Add(vpcGVK, meta.RESTScopeRoot) newPlanner := func(fail bool) (*XRPlanner, *countPlanClient) { - pc := &countPlanClient{funcPlanClient: funcPlanClient{fakePlanClient: fakePlanClient{rsp: &diffv1alpha1.PlanResponse{Action: diffv1alpha1.Action_ACTION_CREATE}}}} + pc := &countPlanClient{rsp: &diffv1alpha1.PlanResponse{Action: diffv1alpha1.Action_ACTION_CREATE}} x := NewXRPlanner(NewPlanner(fake.NewClientBuilder().WithScheme(s).Build(), rm, noCRDs(t), "default", &fakeRouter{client: pc}, time.Second), nil, nil) if fail { pc.fail = map[string]bool{"shared": true} diff --git a/internal/testutils/integration/fixtures.go b/internal/testutils/integration/fixtures.go index 3e065048..9e690bc5 100644 --- a/internal/testutils/integration/fixtures.go +++ b/internal/testutils/integration/fixtures.go @@ -378,15 +378,15 @@ func envtestCRDs(crdDirs, setupFiles []string) ([]*extv1.CustomResourceDefinitio func addUserWithRules(ctx context.Context, env *envtest.Environment, c client.Client, admin *rest.Config, rules []rbacv1.PolicyRule) (*rest.Config, error) { const name = "least-privilege" - role := &rbacv1.ClusterRole{ObjectMeta: metav1.ObjectMeta{Name: name}, Rules: rules} + role := &rbacv1.ClusterRole{Name: name, Rules: rules} if err := c.Create(ctx, role); err != nil { return nil, fmt.Errorf("cannot create ClusterRole %s: %w", name, err) } binding := &rbacv1.ClusterRoleBinding{ - ObjectMeta: metav1.ObjectMeta{Name: name}, - RoleRef: rbacv1.RoleRef{APIGroup: rbacv1.GroupName, Kind: "ClusterRole", Name: name}, - Subjects: []rbacv1.Subject{{APIGroup: rbacv1.GroupName, Kind: rbacv1.UserKind, Name: name}}, + Name: name, + RoleRef: rbacv1.RoleRef{APIGroup: rbacv1.GroupName, Kind: "ClusterRole", Name: name}, + Subjects: []rbacv1.Subject{{APIGroup: rbacv1.GroupName, Kind: rbacv1.UserKind, Name: name}}, } if err := c.Create(ctx, binding); err != nil { return nil, fmt.Errorf("cannot create ClusterRoleBinding %s: %w", name, err) diff --git a/internal/xpkg/configuration.go b/internal/xpkg/configuration.go index 2b06c6d0..1e4a5206 100644 --- a/internal/xpkg/configuration.go +++ b/internal/xpkg/configuration.go @@ -78,9 +78,7 @@ func ResolveConfigurationFunctions(ctx context.Context, cfg *pkgmetav1.Configura } fns = append(fns, pkgv1.Function{ - ObjectMeta: metav1.ObjectMeta{ - Name: path.Base(resolved.Context().RepositoryStr()), - }, + Name: path.Base(resolved.Context().RepositoryStr()), Spec: pkgv1.FunctionSpec{ PackageSpec: pkgv1.PackageSpec{ Package: resolved.Name(), diff --git a/internal/xpkg/configuration_test.go b/internal/xpkg/configuration_test.go index c0d74e2b..e8c7cc31 100644 --- a/internal/xpkg/configuration_test.go +++ b/internal/xpkg/configuration_test.go @@ -118,12 +118,12 @@ func TestResolveConfigurationFunctions(t *testing.T) { }, want: []pkgv1.Function{ { - ObjectMeta: metav1.ObjectMeta{Name: "function-a"}, - Spec: pkgv1.FunctionSpec{PackageSpec: pkgv1.PackageSpec{Package: "ghcr.io/example/function-a:v1.0.0"}}, + Name: "function-a", + Spec: pkgv1.FunctionSpec{PackageSpec: pkgv1.PackageSpec{Package: "ghcr.io/example/function-a:v1.0.0"}}, }, { - ObjectMeta: metav1.ObjectMeta{Name: "function-b"}, - Spec: pkgv1.FunctionSpec{PackageSpec: pkgv1.PackageSpec{Package: "ghcr.io/example/function-b:v0.5.0"}}, + Name: "function-b", + Spec: pkgv1.FunctionSpec{PackageSpec: pkgv1.PackageSpec{Package: "ghcr.io/example/function-b:v0.5.0"}}, }, }, }, @@ -136,12 +136,12 @@ func TestResolveConfigurationFunctions(t *testing.T) { }, want: []pkgv1.Function{ { - ObjectMeta: metav1.ObjectMeta{Name: "function-a"}, - Spec: pkgv1.FunctionSpec{PackageSpec: pkgv1.PackageSpec{Package: "ghcr.io/example/function-a:v1.0.0"}}, + Name: "function-a", + Spec: pkgv1.FunctionSpec{PackageSpec: pkgv1.PackageSpec{Package: "ghcr.io/example/function-a:v1.0.0"}}, }, { - ObjectMeta: metav1.ObjectMeta{Name: "function-b"}, - Spec: pkgv1.FunctionSpec{PackageSpec: pkgv1.PackageSpec{Package: "ghcr.io/example/function-b:v0.5.0"}}, + Name: "function-b", + Spec: pkgv1.FunctionSpec{PackageSpec: pkgv1.PackageSpec{Package: "ghcr.io/example/function-b:v0.5.0"}}, }, }, }, diff --git a/pkg/render/load_test.go b/pkg/render/load_test.go index 1dffe87d..ff432588 100644 --- a/pkg/render/load_test.go +++ b/pkg/render/load_test.go @@ -58,8 +58,7 @@ func TestLoadCompositeResource(t *testing.T) { file: "testdata/xr.yaml", want: want{ xr: &composite.Unstructured{ - Unstructured: unstructured.Unstructured{ - Object: MustLoadJSON(`{ + Object: MustLoadJSON(`{ "apiVersion": "nop.example.org/v1alpha1", "kind": "XNopResource", "metadata": { @@ -69,7 +68,6 @@ func TestLoadCompositeResource(t *testing.T) { "coolField": "I'm cool!" } }`), - }, }, }, }, @@ -112,11 +110,9 @@ func TestLoadXRD(t *testing.T) { file: "testdata/xrd.yaml", want: want{ xrd: &apiextensionsv1.CompositeResourceDefinition{ - TypeMeta: metav1.TypeMeta{ - Kind: apiextensionsv1.CompositeResourceDefinitionKind, - APIVersion: apiextensionsv1.SchemeGroupVersion.String(), - }, - ObjectMeta: metav1.ObjectMeta{Name: "xnopresources.nop.example.org"}, + Kind: apiextensionsv1.CompositeResourceDefinitionKind, + APIVersion: apiextensionsv1.SchemeGroupVersion.String(), + Name: "xnopresources.nop.example.org", Spec: apiextensionsv1.CompositeResourceDefinitionSpec{ Group: "nop.example.org", Names: v1.CustomResourceDefinitionNames{ @@ -179,11 +175,9 @@ func TestLoadComposition(t *testing.T) { file: "testdata/composition.yaml", want: want{ comp: &apiextensionsv1.Composition{ - TypeMeta: metav1.TypeMeta{ - Kind: apiextensionsv1.CompositionKind, - APIVersion: apiextensionsv1.SchemeGroupVersion.String(), - }, - ObjectMeta: metav1.ObjectMeta{Name: "xnopresources.nop.example.org"}, + Kind: apiextensionsv1.CompositionKind, + APIVersion: apiextensionsv1.SchemeGroupVersion.String(), + Name: "xnopresources.nop.example.org", Spec: apiextensionsv1.CompositionSpec{ CompositeTypeRef: apiextensionsv1.TypeReference{ APIVersion: "nop.example.org/v1alpha1", @@ -244,16 +238,12 @@ func TestLoadFunctions(t *testing.T) { want: want{ fns: []pkgv1.Function{ { - TypeMeta: metav1.TypeMeta{ - Kind: pkgv1.FunctionKind, - APIVersion: pkgv1.SchemeGroupVersion.String(), - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "function-auto-ready", - Annotations: map[string]string{ - AnnotationKeyRuntime: string(AnnotationValueRuntimeDocker), - AnnotationKeyRuntimeDockerCleanup: string(AnnotationValueRuntimeDockerCleanupOrphan), - }, + Kind: pkgv1.FunctionKind, + APIVersion: pkgv1.SchemeGroupVersion.String(), + Name: "function-auto-ready", + Annotations: map[string]string{ + AnnotationKeyRuntime: string(AnnotationValueRuntimeDocker), + AnnotationKeyRuntimeDockerCleanup: string(AnnotationValueRuntimeDockerCleanupOrphan), }, Spec: pkgv1.FunctionSpec{ PackageSpec: pkgv1.PackageSpec{ @@ -262,16 +252,12 @@ func TestLoadFunctions(t *testing.T) { }, }, { - TypeMeta: metav1.TypeMeta{ - Kind: pkgv1.FunctionKind, - APIVersion: pkgv1.SchemeGroupVersion.String(), - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "function-dummy", - Annotations: map[string]string{ - AnnotationKeyRuntime: string(AnnotationValueRuntimeDevelopment), - AnnotationKeyRuntimeDevelopmentTarget: "localhost:9444", - }, + Kind: pkgv1.FunctionKind, + APIVersion: pkgv1.SchemeGroupVersion.String(), + Name: "function-dummy", + Annotations: map[string]string{ + AnnotationKeyRuntime: string(AnnotationValueRuntimeDevelopment), + AnnotationKeyRuntimeDevelopmentTarget: "localhost:9444", }, Spec: pkgv1.FunctionSpec{ PackageSpec: pkgv1.PackageSpec{ @@ -280,17 +266,13 @@ func TestLoadFunctions(t *testing.T) { }, }, { - TypeMeta: metav1.TypeMeta{ - Kind: pkgv1.FunctionKind, - APIVersion: pkgv1.SchemeGroupVersion.String(), - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "function-auto-ready", - Annotations: map[string]string{ - AnnotationKeyRuntime: string(AnnotationValueRuntimeDocker), - AnnotationKeyRuntimeDockerCleanup: string(AnnotationValueRuntimeDockerCleanupOrphan), - AnnotationKeyRuntimeNamedContainer: "function-auto-ready", - }, + Kind: pkgv1.FunctionKind, + APIVersion: pkgv1.SchemeGroupVersion.String(), + Name: "function-auto-ready", + Annotations: map[string]string{ + AnnotationKeyRuntime: string(AnnotationValueRuntimeDocker), + AnnotationKeyRuntimeDockerCleanup: string(AnnotationValueRuntimeDockerCleanupOrphan), + AnnotationKeyRuntimeNamedContainer: "function-auto-ready", }, Spec: pkgv1.FunctionSpec{ PackageSpec: pkgv1.PackageSpec{ @@ -347,13 +329,13 @@ func TestLoadCredentials(t *testing.T) { want: want{ secrets: []corev1.Secret{ { - TypeMeta: metav1.TypeMeta{APIVersion: "v1", Kind: "Secret"}, - ObjectMeta: metav1.ObjectMeta{Name: "creds-a"}, - Data: map[string][]byte{"token": []byte("secret")}, + APIVersion: "v1", Kind: "Secret", + Name: "creds-a", + Data: map[string][]byte{"token": []byte("secret")}, }, { - TypeMeta: metav1.TypeMeta{APIVersion: "v1", Kind: "Secret"}, - ObjectMeta: metav1.ObjectMeta{Name: "creds-b"}, + APIVersion: "v1", Kind: "Secret", + Name: "creds-b", StringData: map[string]string{"password": "hunter2"}, }, }, @@ -439,7 +421,7 @@ func TestLoadObservedResources(t *testing.T) { want: want{ ors: []composed.Unstructured{ { - Unstructured: unstructured.Unstructured{Object: MustLoadJSON(`{ + Object: MustLoadJSON(`{ "apiVersion": "example.org/v1alpha1", "kind": "ComposedResource", "metadata": { @@ -451,10 +433,10 @@ func TestLoadObservedResources(t *testing.T) { "spec": { "coolField": "I'm cool!" } - }`)}, + }`), }, { - Unstructured: unstructured.Unstructured{Object: MustLoadJSON(`{ + Object: MustLoadJSON(`{ "apiVersion": "example.org/v1alpha1", "kind": "ComposedResource", "metadata": { @@ -466,7 +448,7 @@ func TestLoadObservedResources(t *testing.T) { "spec": { "coolerField": "I'm cooler!" } - }`)}, + }`), }, }, }, diff --git a/pkg/render/output_test.go b/pkg/render/output_test.go index b4c4faf3..e4d3b363 100644 --- a/pkg/render/output_test.go +++ b/pkg/render/output_test.go @@ -220,9 +220,9 @@ func TestReplaceConditionTimestamps(t *testing.T) { reason: "A typed (non-unstructured) object should be converted without error.", args: args{ o: &corev1.ConfigMap{ - TypeMeta: metav1.TypeMeta{APIVersion: "v1", Kind: "ConfigMap"}, - ObjectMeta: metav1.ObjectMeta{Name: "test"}, - Data: map[string]string{"key": "value"}, + APIVersion: "v1", Kind: "ConfigMap", + Name: "test", + Data: map[string]string{"key": "value"}, }, }, want: want{ diff --git a/pkg/render/render_test.go b/pkg/render/render_test.go index 96490396..e8bc9e8f 100644 --- a/pkg/render/render_test.go +++ b/pkg/render/render_test.go @@ -93,7 +93,7 @@ func TestOverrideFunctionAnnotations(t *testing.T) { } func functionWithAnnotations(annotations map[string]string) pkgv1.Function { - return pkgv1.Function{ObjectMeta: metav1.ObjectMeta{Annotations: annotations}} + return pkgv1.Function{Annotations: annotations} } func TestFunctionAddressesStop(t *testing.T) { @@ -101,7 +101,7 @@ func TestFunctionAddressesStop(t *testing.T) { errB := errors.New("boom b") stopReturns := func(name string, err error) startedRuntime { - return startedRuntime{name: name, RuntimeContext: RuntimeContext{Target: name + ":9443", Stop: func(context.Context) error { return err }}} + return startedRuntime{name: name, Target: name + ":9443", Stop: func(context.Context) error { return err }} } type args struct { @@ -215,10 +215,10 @@ func TestStopFunctionRuntimes(t *testing.T) { var fa *FunctionAddresses if !tc.args.noRuntimes { fa = &FunctionAddresses{runtimes: []startedRuntime{ - {name: "fn", RuntimeContext: RuntimeContext{Target: "fn:9443", Stop: func(ctx context.Context) error { + {name: "fn", Target: "fn:9443", Stop: func(ctx context.Context) error { got.ctxErr = ctx.Err() return tc.args.stopErr - }}}, + }}, }} } @@ -286,7 +286,7 @@ func TestStartFunctionRuntimes(t *testing.T) { } } fn := func(name string) pkgv1.Function { - return pkgv1.Function{ObjectMeta: metav1.ObjectMeta{Name: name}} + return pkgv1.Function{Name: name} } type args struct { diff --git a/pkg/render/session_test.go b/pkg/render/session_test.go index 8818286a..e1802548 100644 --- a/pkg/render/session_test.go +++ b/pkg/render/session_test.go @@ -481,7 +481,7 @@ func TestSessionSweepsOnlyItsOwnNetworks(t *testing.T) { t.Run(name, func(t *testing.T) { cli := &fakeDocker{} s := NewSession(tc.flags, logging.NewNopLogger(), WithDockerClient(cli)) - cli.networks = []network.Summary{{Network: network.Network{ID: "stray", Labels: managedLabels(s.ID())}}} + cli.networks = []network.Summary{{ID: "stray", Labels: managedLabels(s.ID())}} if _, err := s.Start(t.Context(), nil); err != nil { t.Fatalf("\n%s\nStart(...): unexpected error: %v", tc.reason, err) @@ -518,7 +518,7 @@ func TestSessionWithDockerClient(t *testing.T) { cli := &fakeDocker{ host: "tcp://remote:2376", containers: []container.Summary{{ID: "dead-fn", State: container.StateRunning, Labels: managedLabels(deadID)}}, - networks: []network.Summary{{Network: network.Network{ID: "dead-net", Labels: managedLabels(deadID)}}}, + networks: []network.Summary{{ID: "dead-net", Labels: managedLabels(deadID)}}, } s := NewSession(EngineFlags{CrossplaneImage: "render-image"}, logging.NewNopLogger(), WithDockerClient(cli), @@ -635,7 +635,7 @@ func (f *fakeDocker) NetworkList(_ context.Context, o client.NetworkListOptions) func (f *fakeDocker) NetworkCreate(_ context.Context, name string, o client.NetworkCreateOptions) (client.NetworkCreateResult, error) { f.mu.Lock() f.network = name - f.networks = append(f.networks, network.Summary{Network: network.Network{ID: "net-id", Name: name, Labels: o.Labels}}) + f.networks = append(f.networks, network.Summary{ID: "net-id", Name: name, Labels: o.Labels}) f.mu.Unlock() return client.NetworkCreateResult{ID: "net-id"}, nil } diff --git a/pkg/validate/validate_test.go b/pkg/validate/validate_test.go index a5691729..f2c9f60e 100644 --- a/pkg/validate/validate_test.go +++ b/pkg/validate/validate_test.go @@ -31,11 +31,9 @@ import ( // testCRD is a minimal CRD whose schema requires spec.replicas as an integer. var testCRD = &extv1.CustomResourceDefinition{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "apiextensions.k8s.io/v1", - Kind: "CustomResourceDefinition", - }, - ObjectMeta: metav1.ObjectMeta{Name: "test"}, + APIVersion: "apiextensions.k8s.io/v1", + Kind: "CustomResourceDefinition", + Name: "test", Spec: extv1.CustomResourceDefinitionSpec{ Group: "test.org", Names: extv1.CustomResourceDefinitionNames{ @@ -69,11 +67,9 @@ var testCRD = &extv1.CustomResourceDefinition{ // testCRDWithCEL requires minReplicas <= replicas <= maxReplicas. var testCRDWithCEL = &extv1.CustomResourceDefinition{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "apiextensions.k8s.io/v1", - Kind: "CustomResourceDefinition", - }, - ObjectMeta: metav1.ObjectMeta{Name: "test-cel"}, + APIVersion: "apiextensions.k8s.io/v1", + Kind: "CustomResourceDefinition", + Name: "test-cel", Spec: extv1.CustomResourceDefinitionSpec{ Group: "test.org", Names: extv1.CustomResourceDefinitionNames{ @@ -110,11 +106,9 @@ var testCRDWithCEL = &extv1.CustomResourceDefinition{ // only declares v1beta1. When used BEFORE testCRD in the crds slice, // applyDefaults matches it first and fails because v1alpha1 is missing. var testCRDNoMatchingVersion = &extv1.CustomResourceDefinition{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "apiextensions.k8s.io/v1", - Kind: "CustomResourceDefinition", - }, - ObjectMeta: metav1.ObjectMeta{Name: "test-other-version"}, + APIVersion: "apiextensions.k8s.io/v1", + Kind: "CustomResourceDefinition", + Name: "test-other-version", Spec: extv1.CustomResourceDefinitionSpec{ Group: "test.org", Names: extv1.CustomResourceDefinitionNames{ From 5922f1d74144761dc75999927abf5c24e5f86105 Mon Sep 17 00:00:00 2001 From: Adam Wolfe Gordon Date: Fri, 20 Nov 2026 10:27:14 -0600 Subject: [PATCH 3/3] Remove unused imports left behind by the linter Signed-off-by: Adam Wolfe Gordon --- cmd/crossplane/composition/generate.go | 1 - cmd/crossplane/dependency/dependency_test.go | 1 - cmd/crossplane/function/generate_test.go | 1 - cmd/crossplane/project/build_test.go | 1 - cmd/crossplane/project/simulate_test.go | 1 - cmd/crossplane/render/contextfn/wire.go | 2 -- cmd/crossplane/render/op/load_test.go | 1 - cmd/crossplane/top/top_test.go | 1 - cmd/crossplane/xpkg/get_crds_test.go | 1 - cmd/crossplane/xpkg/install.go | 1 - .../xpkg/install_integration_test.go | 1 - cmd/crossplane/xrd/convert_test.go | 1 - cmd/crossplane/xrd/generate_test.go | 1 - internal/dependency/manager_test.go | 1 - .../diff/diffprocessor/diff_processor_test.go | 1 - .../diffprocessor/function_provider_test.go | 1 - .../project_function_provider_test.go | 1 - .../diff/diffprocessor/render_engine_test.go | 1 - .../diff/renderer/comp_diff_renderer_test.go | 1 - internal/project/build_test.go | 1 - internal/project/controlplane/controlplane.go | 1 - internal/project/install_test.go | 1 - .../project/projectfile/projectfile_test.go | 1 - internal/project/render.go | 1 - internal/schemas/generator/json_test.go | 1 - internal/simulate/result_test.go | 18 ++++++++---------- internal/simulate/run_test.go | 1 - internal/xpkg/configuration.go | 1 - internal/xpkg/configuration_test.go | 1 - pkg/render/load_test.go | 1 - pkg/render/render_test.go | 1 - pkg/validate/validate_test.go | 1 - 32 files changed, 8 insertions(+), 42 deletions(-) diff --git a/cmd/crossplane/composition/generate.go b/cmd/crossplane/composition/generate.go index 93d3c0a3..7982c1f4 100644 --- a/cmd/crossplane/composition/generate.go +++ b/cmd/crossplane/composition/generate.go @@ -24,7 +24,6 @@ import ( "strings" "github.com/spf13/afero" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" "sigs.k8s.io/yaml" diff --git a/cmd/crossplane/dependency/dependency_test.go b/cmd/crossplane/dependency/dependency_test.go index 8cfbefff..584c3573 100644 --- a/cmd/crossplane/dependency/dependency_test.go +++ b/cmd/crossplane/dependency/dependency_test.go @@ -31,7 +31,6 @@ import ( "github.com/crossplane/crossplane-runtime/v2/pkg/logging" - "github.com/crossplane/cli/v2/cmd/crossplane/common" "github.com/crossplane/cli/v2/internal/config" "github.com/crossplane/cli/v2/internal/terminal" ) diff --git a/cmd/crossplane/function/generate_test.go b/cmd/crossplane/function/generate_test.go index 7cd3e0f8..a4900133 100644 --- a/cmd/crossplane/function/generate_test.go +++ b/cmd/crossplane/function/generate_test.go @@ -24,7 +24,6 @@ import ( "github.com/google/go-cmp/cmp" "github.com/spf13/afero" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/yaml" apiextv1 "github.com/crossplane/crossplane/apis/v2/apiextensions/v1" diff --git a/cmd/crossplane/project/build_test.go b/cmd/crossplane/project/build_test.go index 53aa4bae..a8fe86fb 100644 --- a/cmd/crossplane/project/build_test.go +++ b/cmd/crossplane/project/build_test.go @@ -31,7 +31,6 @@ import ( "github.com/crossplane/crossplane-runtime/v2/pkg/logging" - "github.com/crossplane/cli/v2/cmd/crossplane/common" "github.com/crossplane/cli/v2/internal/config" "github.com/crossplane/cli/v2/internal/terminal" ) diff --git a/cmd/crossplane/project/simulate_test.go b/cmd/crossplane/project/simulate_test.go index 1d7ff03c..f76d0e21 100644 --- a/cmd/crossplane/project/simulate_test.go +++ b/cmd/crossplane/project/simulate_test.go @@ -33,7 +33,6 @@ import ( "github.com/crossplane/cli/v2/internal/config" dp "github.com/crossplane/cli/v2/internal/diff/diffprocessor" "github.com/crossplane/cli/v2/internal/simulate" - "github.com/crossplane/cli/v2/pkg/render" ) // parseSimulate parses args as `simulate` flags, running kong's validation. diff --git a/cmd/crossplane/render/contextfn/wire.go b/cmd/crossplane/render/contextfn/wire.go index 5131b92a..c06aba18 100644 --- a/cmd/crossplane/render/contextfn/wire.go +++ b/cmd/crossplane/render/contextfn/wire.go @@ -17,8 +17,6 @@ limitations under the License. package contextfn import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - apiextensionsv1 "github.com/crossplane/crossplane/apis/v2/apiextensions/v1" opsv1alpha1 "github.com/crossplane/crossplane/apis/v2/ops/v1alpha1" pkgv1 "github.com/crossplane/crossplane/apis/v2/pkg/v1" diff --git a/cmd/crossplane/render/op/load_test.go b/cmd/crossplane/render/op/load_test.go index 436364bf..2c05ce45 100644 --- a/cmd/crossplane/render/op/load_test.go +++ b/cmd/crossplane/render/op/load_test.go @@ -22,7 +22,6 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/spf13/afero" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" opsv1alpha1 "github.com/crossplane/crossplane/apis/v2/ops/v1alpha1" diff --git a/cmd/crossplane/top/top_test.go b/cmd/crossplane/top/top_test.go index 1a41033c..1234fe29 100644 --- a/cmd/crossplane/top/top_test.go +++ b/cmd/crossplane/top/top_test.go @@ -11,7 +11,6 @@ import ( "github.com/google/go-cmp/cmp/cmpopts" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" v1 "github.com/crossplane/crossplane/apis/v2/pkg/v1" ) diff --git a/cmd/crossplane/xpkg/get_crds_test.go b/cmd/crossplane/xpkg/get_crds_test.go index af28dc8c..a4fdb78f 100644 --- a/cmd/crossplane/xpkg/get_crds_test.go +++ b/cmd/crossplane/xpkg/get_crds_test.go @@ -26,7 +26,6 @@ import ( "github.com/invopop/jsonschema" "github.com/spf13/afero" extv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/crossplane/crossplane-runtime/v2/pkg/test" ) diff --git a/cmd/crossplane/xpkg/install.go b/cmd/crossplane/xpkg/install.go index 3045bbb8..9392c34c 100644 --- a/cmd/crossplane/xpkg/install.go +++ b/cmd/crossplane/xpkg/install.go @@ -26,7 +26,6 @@ import ( "github.com/google/go-containerregistry/pkg/name" corev1 "k8s.io/api/core/v1" kerrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/wait" ctrl "sigs.k8s.io/controller-runtime" diff --git a/cmd/crossplane/xpkg/install_integration_test.go b/cmd/crossplane/xpkg/install_integration_test.go index 132bdca8..bae922aa 100644 --- a/cmd/crossplane/xpkg/install_integration_test.go +++ b/cmd/crossplane/xpkg/install_integration_test.go @@ -33,7 +33,6 @@ import ( extv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" kerrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/meta" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/cmd/crossplane/xrd/convert_test.go b/cmd/crossplane/xrd/convert_test.go index fdbb4eca..7333a8b9 100644 --- a/cmd/crossplane/xrd/convert_test.go +++ b/cmd/crossplane/xrd/convert_test.go @@ -27,7 +27,6 @@ import ( "github.com/invopop/jsonschema" "github.com/spf13/afero" extv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" apiextensionsv1 "github.com/crossplane/crossplane/apis/v2/apiextensions/v1" diff --git a/cmd/crossplane/xrd/generate_test.go b/cmd/crossplane/xrd/generate_test.go index 1e6a5c44..c46abadf 100644 --- a/cmd/crossplane/xrd/generate_test.go +++ b/cmd/crossplane/xrd/generate_test.go @@ -25,7 +25,6 @@ import ( "github.com/google/go-cmp/cmp/cmpopts" "github.com/spf13/afero" extv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "sigs.k8s.io/yaml" diff --git a/internal/dependency/manager_test.go b/internal/dependency/manager_test.go index 38a7def1..2707bf61 100644 --- a/internal/dependency/manager_test.go +++ b/internal/dependency/manager_test.go @@ -29,7 +29,6 @@ import ( "github.com/google/go-cmp/cmp" "github.com/spf13/afero" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/yaml" "github.com/crossplane/crossplane-runtime/v2/pkg/errors" diff --git a/internal/diff/diffprocessor/diff_processor_test.go b/internal/diff/diffprocessor/diff_processor_test.go index 89da9988..a2cd4f15 100644 --- a/internal/diff/diffprocessor/diff_processor_test.go +++ b/internal/diff/diffprocessor/diff_processor_test.go @@ -14,7 +14,6 @@ import ( "github.com/sergi/go-diff/diffmatchpatch" corev1 "k8s.io/api/core/v1" extv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" un "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/internal/diff/diffprocessor/function_provider_test.go b/internal/diff/diffprocessor/function_provider_test.go index 373ea45f..4974545c 100644 --- a/internal/diff/diffprocessor/function_provider_test.go +++ b/internal/diff/diffprocessor/function_provider_test.go @@ -25,7 +25,6 @@ import ( "testing" gcmp "github.com/google/go-cmp/cmp" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" apiextensionsv1 "github.com/crossplane/crossplane/apis/v2/apiextensions/v1" pkgv1 "github.com/crossplane/crossplane/apis/v2/pkg/v1" diff --git a/internal/diff/diffprocessor/project_function_provider_test.go b/internal/diff/diffprocessor/project_function_provider_test.go index 708a276b..55012c4f 100644 --- a/internal/diff/diffprocessor/project_function_provider_test.go +++ b/internal/diff/diffprocessor/project_function_provider_test.go @@ -24,7 +24,6 @@ import ( "testing" gcmp "github.com/google/go-cmp/cmp" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/crossplane/crossplane-runtime/v2/pkg/errors" diff --git a/internal/diff/diffprocessor/render_engine_test.go b/internal/diff/diffprocessor/render_engine_test.go index 08653b39..2aee8537 100644 --- a/internal/diff/diffprocessor/render_engine_test.go +++ b/internal/diff/diffprocessor/render_engine_test.go @@ -25,7 +25,6 @@ import ( "time" gcmp "github.com/google/go-cmp/cmp" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/crossplane/crossplane-runtime/v2/pkg/errors" "github.com/crossplane/crossplane-runtime/v2/pkg/logging" diff --git a/internal/diff/renderer/comp_diff_renderer_test.go b/internal/diff/renderer/comp_diff_renderer_test.go index b9725cd4..82427cbf 100644 --- a/internal/diff/renderer/comp_diff_renderer_test.go +++ b/internal/diff/renderer/comp_diff_renderer_test.go @@ -6,7 +6,6 @@ import ( "testing" gcmp "github.com/google/go-cmp/cmp" - corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime/schema" dt "github.com/crossplane/cli/v2/internal/diff/result" diff --git a/internal/project/build_test.go b/internal/project/build_test.go index 31a14a32..39d54f64 100644 --- a/internal/project/build_test.go +++ b/internal/project/build_test.go @@ -34,7 +34,6 @@ import ( "github.com/google/go-containerregistry/pkg/v1/random" "github.com/google/go-containerregistry/pkg/v1/tarball" "github.com/spf13/afero" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/crossplane/crossplane-runtime/v2/pkg/xpkg" diff --git a/internal/project/controlplane/controlplane.go b/internal/project/controlplane/controlplane.go index 4ac093c1..68b10ee0 100644 --- a/internal/project/controlplane/controlplane.go +++ b/internal/project/controlplane/controlplane.go @@ -33,7 +33,6 @@ import ( batchv1 "k8s.io/api/batch/v1" corev1 "k8s.io/api/core/v1" kerrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" clientgoscheme "k8s.io/client-go/kubernetes/scheme" diff --git a/internal/project/install_test.go b/internal/project/install_test.go index d047c616..6fe64975 100644 --- a/internal/project/install_test.go +++ b/internal/project/install_test.go @@ -25,7 +25,6 @@ import ( "github.com/google/go-cmp/cmp/cmpopts" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" diff --git a/internal/project/projectfile/projectfile_test.go b/internal/project/projectfile/projectfile_test.go index 17867220..59d5bd92 100644 --- a/internal/project/projectfile/projectfile_test.go +++ b/internal/project/projectfile/projectfile_test.go @@ -22,7 +22,6 @@ import ( "github.com/google/go-cmp/cmp" "github.com/spf13/afero" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/yaml" "github.com/crossplane/cli/v2/apis/dev/v1alpha1" diff --git a/internal/project/render.go b/internal/project/render.go index af605e5a..ef649c1c 100644 --- a/internal/project/render.go +++ b/internal/project/render.go @@ -27,7 +27,6 @@ import ( v1 "github.com/google/go-containerregistry/pkg/v1" "github.com/google/go-containerregistry/pkg/v1/daemon" "github.com/moby/moby/client" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/crossplane/crossplane-runtime/v2/pkg/errors" "github.com/crossplane/crossplane-runtime/v2/pkg/xpkg" diff --git a/internal/schemas/generator/json_test.go b/internal/schemas/generator/json_test.go index 0125a4ea..2dfe3500 100644 --- a/internal/schemas/generator/json_test.go +++ b/internal/schemas/generator/json_test.go @@ -25,7 +25,6 @@ import ( "github.com/invopop/jsonschema" "github.com/spf13/afero" extv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/kube-openapi/pkg/validation/spec" ) diff --git a/internal/simulate/result_test.go b/internal/simulate/result_test.go index 669ecf89..5290f37c 100644 --- a/internal/simulate/result_test.go +++ b/internal/simulate/result_test.go @@ -186,16 +186,14 @@ func TestRenderJSONProjectFields(t *testing.T) { Warnings: []Warning{{Message: "heads up", Context: map[string]string{"k": "v"}}}, Notes: []string{"a note"}, - Result: plan.Result{ - FormatVersion: plan.ResultFormatVersion, - Errored: true, - Summary: plan.Summary{Destroy: 1}, - Plans: []*plan.ResourcePlan{{ - APIVersion: "v1", Kind: "ConfigMap", Name: "cm", Action: plan.ActionDelete, Composite: &xr, - Changes: []plan.FieldChange{{Path: "data.k", Actual: &plan.Value{Value: "v"}}}, - DryRun: &plan.Verification{SkipReason: "forbidden", Detail: "no create permission"}, - }}, - }, + FormatVersion: plan.ResultFormatVersion, + Errored: true, + Summary: plan.Summary{Destroy: 1}, + Plans: []*plan.ResourcePlan{{ + APIVersion: "v1", Kind: "ConfigMap", Name: "cm", Action: plan.ActionDelete, Composite: &xr, + Changes: []plan.FieldChange{{Path: "data.k", Actual: &plan.Value{Value: "v"}}}, + DryRun: &plan.Verification{SkipReason: "forbidden", Detail: "no create permission"}, + }}, } var buf bytes.Buffer r, _ := NewRenderer(plan.FormatJSON) diff --git a/internal/simulate/run_test.go b/internal/simulate/run_test.go index 39a78836..994c6fce 100644 --- a/internal/simulate/run_test.go +++ b/internal/simulate/run_test.go @@ -31,7 +31,6 @@ import ( "github.com/google/go-containerregistry/pkg/name" "github.com/sergi/go-diff/diffmatchpatch" corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" un "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime/schema" k8stypes "k8s.io/apimachinery/pkg/types" diff --git a/internal/xpkg/configuration.go b/internal/xpkg/configuration.go index 1e4a5206..7d36f921 100644 --- a/internal/xpkg/configuration.go +++ b/internal/xpkg/configuration.go @@ -22,7 +22,6 @@ import ( "path" "github.com/spf13/afero" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/yaml" "github.com/crossplane/crossplane-runtime/v2/pkg/errors" diff --git a/internal/xpkg/configuration_test.go b/internal/xpkg/configuration_test.go index e8c7cc31..b3dae650 100644 --- a/internal/xpkg/configuration_test.go +++ b/internal/xpkg/configuration_test.go @@ -23,7 +23,6 @@ import ( "github.com/google/go-cmp/cmp" "github.com/spf13/afero" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" pkgmetav1 "github.com/crossplane/crossplane/apis/v2/pkg/meta/v1" pkgv1 "github.com/crossplane/crossplane/apis/v2/pkg/v1" diff --git a/pkg/render/load_test.go b/pkg/render/load_test.go index ff432588..4b4f6cc5 100644 --- a/pkg/render/load_test.go +++ b/pkg/render/load_test.go @@ -27,7 +27,6 @@ import ( "github.com/spf13/afero" corev1 "k8s.io/api/core/v1" v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" runtime "k8s.io/apimachinery/pkg/runtime" diff --git a/pkg/render/render_test.go b/pkg/render/render_test.go index e8bc9e8f..4dbf628f 100644 --- a/pkg/render/render_test.go +++ b/pkg/render/render_test.go @@ -6,7 +6,6 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/crossplane/crossplane-runtime/v2/pkg/errors" "github.com/crossplane/crossplane-runtime/v2/pkg/logging" diff --git a/pkg/validate/validate_test.go b/pkg/validate/validate_test.go index f2c9f60e..434ae4e1 100644 --- a/pkg/validate/validate_test.go +++ b/pkg/validate/validate_test.go @@ -22,7 +22,6 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" extv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "github.com/crossplane/crossplane-runtime/v2/pkg/errors"