Skip to content

Commit

Permalink
chore: bump deps and align APIs to match KGO
Browse files Browse the repository at this point in the history
  • Loading branch information
czeslavo committed Feb 21, 2025
1 parent d176d42 commit 0e034cd
Show file tree
Hide file tree
Showing 19 changed files with 68 additions and 60 deletions.
2 changes: 1 addition & 1 deletion config/crd/incubator/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- https://github.com/kong/kubernetes-configuration/config/crd/ingress-controller-incubator?ref=v1.1.0 # Version is auto-updated by the generating script.
- https://github.com/kong/kubernetes-configuration/config/crd/ingress-controller-incubator?ref=b45dead920d4 # Version is auto-updated by the generating script.
2 changes: 1 addition & 1 deletion config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- https://github.com/kong/kubernetes-configuration/config/crd/ingress-controller?ref=v1.1.0 # Version is auto-updated by the generating script.
- https://github.com/kong/kubernetes-configuration/config/crd/ingress-controller?ref=b45dead920d4 # Version is auto-updated by the generating script.
18 changes: 9 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ require (
github.com/jpillora/backoff v1.0.0
github.com/kong/go-database-reconciler v1.16.1
github.com/kong/go-kong v0.63.0
github.com/kong/kubernetes-configuration v1.1.0
github.com/kong/kubernetes-configuration v1.1.1-0.20250219125458-b45dead920d4
github.com/kong/kubernetes-telemetry v0.1.8
github.com/kong/kubernetes-testing-framework v0.47.2
github.com/lithammer/dedent v1.1.0
Expand All @@ -57,12 +57,12 @@ require (
go.uber.org/goleak v1.3.0
go.uber.org/zap v1.27.0
google.golang.org/api v0.220.0
k8s.io/api v0.32.1
k8s.io/apiextensions-apiserver v0.32.1
k8s.io/apimachinery v0.32.1
k8s.io/client-go v0.32.1
k8s.io/component-base v0.32.1
sigs.k8s.io/controller-runtime v0.20.1
k8s.io/api v0.32.2
k8s.io/apiextensions-apiserver v0.32.2
k8s.io/apimachinery v0.32.2
k8s.io/client-go v0.32.2
k8s.io/component-base v0.32.2
sigs.k8s.io/controller-runtime v0.20.2
sigs.k8s.io/e2e-framework v0.6.0
sigs.k8s.io/gateway-api v1.2.1
sigs.k8s.io/kustomize/api v0.19.0
Expand All @@ -84,7 +84,7 @@ require (
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0 // indirect
go.opentelemetry.io/otel/sdk v1.34.0 // indirect
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
k8s.io/apiserver v0.32.1 // indirect
k8s.io/apiserver v0.32.2 // indirect
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.0 // indirect
)

Expand All @@ -97,7 +97,7 @@ require (
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
github.com/Kong/go-diff v1.2.2 // indirect
github.com/Kong/gojsondiff v1.3.2 // indirect
github.com/Kong/sdk-konnect-go v0.2.4
github.com/Kong/sdk-konnect-go v0.2.13
github.com/MakeNowJust/heredoc v1.0.0 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver/v3 v3.3.0 // indirect
Expand Down
44 changes: 22 additions & 22 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ github.com/Kong/go-diff v1.2.2 h1:KKKaqHc8IxuguFVIZMNt3bi6YuC/t9r7BGD8bOOpSgM=
github.com/Kong/go-diff v1.2.2/go.mod h1:nlvdwVZQk3Rm+tbI0cDmKFrOjghtcZTrZBp+UruvvA8=
github.com/Kong/gojsondiff v1.3.2 h1:qIOVq2mUXt+NXy8Be5gRUee9TP3Ve0MbQSafg9bXKZE=
github.com/Kong/gojsondiff v1.3.2/go.mod h1:DiIxtU59q4alK7ecP+7k56C5UjgOviJ5gQVR2esEhYw=
github.com/Kong/sdk-konnect-go v0.2.4 h1:mMgMA/4ULHUQrsji1C60pxvLdxrV1g8WSHowMS4eqcI=
github.com/Kong/sdk-konnect-go v0.2.4/go.mod h1:xsmTIkBbmVyUh1nRFjQMOhxYIPDl+sMfmRmPuZHtwLE=
github.com/Kong/sdk-konnect-go v0.2.13 h1:WMuxzfO1BTcmUINF3pboiuXp5sFmunKwCXy7tjMeGHc=
github.com/Kong/sdk-konnect-go v0.2.13/go.mod h1:xsmTIkBbmVyUh1nRFjQMOhxYIPDl+sMfmRmPuZHtwLE=
github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ=
github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE=
github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI=
Expand Down Expand Up @@ -227,8 +227,8 @@ github.com/kong/go-database-reconciler v1.16.1 h1:qcQzEuMGfpNjx3UgulBOKulKA+upmH
github.com/kong/go-database-reconciler v1.16.1/go.mod h1:7CGvStUvUOmUnodUFsWcW3PX2bJgnaKClJ/yhNGEVIE=
github.com/kong/go-kong v0.60.0 h1:CVrLXRLVE+Gl4IZ3tdvpO7xNDz3c9YLTmra/HvT4oM8=
github.com/kong/go-kong v0.60.0/go.mod h1:t1eMY8GRS6778uQNzxgzRgnA3YKBXSZOEvYbNocH/aA=
github.com/kong/kubernetes-configuration v1.1.0 h1:zCj7QlOiZgwQ2wSNlVNR0K6Z+plXTalfihtDzLXQWzs=
github.com/kong/kubernetes-configuration v1.1.0/go.mod h1:Z9Yo8DyBe/4zw/cgoSYafqHzuviKINVSq1b8D60F0u8=
github.com/kong/kubernetes-configuration v1.1.1-0.20250219125458-b45dead920d4 h1:cKGIpPM55LOJ2YEbbuKDj/OyJ4Zvz38c/gUJ/zi/JT8=
github.com/kong/kubernetes-configuration v1.1.1-0.20250219125458-b45dead920d4/go.mod h1:bTJv/IsSCE9Ux+9RY9fEMCU9yehBWAvrSXc8iWx7OGo=
github.com/kong/kubernetes-telemetry v0.1.8 h1:nbtUmXW9xkzRO7dgvrgVrJZiRksATk4XHrqX+78g/5k=
github.com/kong/kubernetes-telemetry v0.1.8/go.mod h1:ZEQY/4DddKoe5XA7UTOIbdI/4d6ZRcrzh2ezRxnuyl0=
github.com/kong/kubernetes-testing-framework v0.47.2 h1:+2Z9anTpbV/hwNeN+NFQz53BMU+g3QJydkweBp3tULo=
Expand Down Expand Up @@ -309,12 +309,12 @@ github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W
github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc=
github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0=
github.com/onsi/ginkgo/v2 v2.21.0 h1:7rg/4f3rB88pb5obDgNZrNHrQ4e6WpjonchcpuBRnZM=
github.com/onsi/ginkgo/v2 v2.21.0/go.mod h1:7Du3c42kxCUegi0IImZ1wUQzMBVecgIHjR1C+NkhLQo=
github.com/onsi/ginkgo/v2 v2.22.0 h1:Yed107/8DjTr0lKCNt7Dn8yQ6ybuDRQoMGrNFKzMfHg=
github.com/onsi/ginkgo/v2 v2.22.0/go.mod h1:7Du3c42kxCUegi0IImZ1wUQzMBVecgIHjR1C+NkhLQo=
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.35.1 h1:Cwbd75ZBPxFSuZ6T+rN/WCb/gOc6YgFBXLlZLhC7Ds4=
github.com/onsi/gomega v1.35.1/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog=
github.com/onsi/gomega v1.36.1 h1:bJDPBO7ibjxcbHMgSCoo4Yj18UWbKDlLwX1x9sybDcw=
github.com/onsi/gomega v1.36.1/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog=
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.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug=
Expand Down Expand Up @@ -565,20 +565,20 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU=
gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU=
k8s.io/api v0.32.1 h1:f562zw9cy+GvXzXf0CKlVQ7yHJVYzLfL6JAS4kOAaOc=
k8s.io/api v0.32.1/go.mod h1:/Yi/BqkuueW1BgpoePYBRdDYfjPF5sgTr5+YqDZra5k=
k8s.io/apiextensions-apiserver v0.32.1 h1:hjkALhRUeCariC8DiVmb5jj0VjIc1N0DREP32+6UXZw=
k8s.io/apiextensions-apiserver v0.32.1/go.mod h1:sxWIGuGiYov7Io1fAS2X06NjMIk5CbRHc2StSmbaQto=
k8s.io/apimachinery v0.32.1 h1:683ENpaCBjma4CYqsmZyhEzrGz6cjn1MY/X2jB2hkZs=
k8s.io/apimachinery v0.32.1/go.mod h1:GpHVgxoKlTxClKcteaeuF1Ul/lDVb74KpZcxcmLDElE=
k8s.io/apiserver v0.32.1 h1:oo0OozRos66WFq87Zc5tclUX2r0mymoVHRq8JmR7Aak=
k8s.io/apiserver v0.32.1/go.mod h1:UcB9tWjBY7aryeI5zAgzVJB/6k7E97bkr1RgqDz0jPw=
k8s.io/api v0.32.2 h1:bZrMLEkgizC24G9eViHGOPbW+aRo9duEISRIJKfdJuw=
k8s.io/api v0.32.2/go.mod h1:hKlhk4x1sJyYnHENsrdCWw31FEmCijNGPJO5WzHiJ6Y=
k8s.io/apiextensions-apiserver v0.32.2 h1:2YMk285jWMk2188V2AERy5yDwBYrjgWYggscghPCvV4=
k8s.io/apiextensions-apiserver v0.32.2/go.mod h1:GPwf8sph7YlJT3H6aKUWtd0E+oyShk/YHWQHf/OOgCA=
k8s.io/apimachinery v0.32.2 h1:yoQBR9ZGkA6Rgmhbp/yuT9/g+4lxtsGYwW6dR6BDPLQ=
k8s.io/apimachinery v0.32.2/go.mod h1:GpHVgxoKlTxClKcteaeuF1Ul/lDVb74KpZcxcmLDElE=
k8s.io/apiserver v0.32.2 h1:WzyxAu4mvLkQxwD9hGa4ZfExo3yZZaYzoYvvVDlM6vw=
k8s.io/apiserver v0.32.2/go.mod h1:PEwREHiHNU2oFdte7BjzA1ZyjWjuckORLIK/wLV5goM=
k8s.io/cli-runtime v0.32.1 h1:19nwZPlYGJPUDbhAxDIS2/oydCikvKMHsxroKNGA2mM=
k8s.io/cli-runtime v0.32.1/go.mod h1:NJPbeadVFnV2E7B7vF+FvU09mpwYlZCu8PqjzfuOnkY=
k8s.io/client-go v0.32.1 h1:otM0AxdhdBIaQh7l1Q0jQpmo7WOFIk5FFa4bg6YMdUU=
k8s.io/client-go v0.32.1/go.mod h1:aTTKZY7MdxUaJ/KiUs8D+GssR9zJZi77ZqtzcGXIiDg=
k8s.io/component-base v0.32.1 h1:/5IfJ0dHIKBWysGV0yKTFfacZ5yNV1sulPh3ilJjRZk=
k8s.io/component-base v0.32.1/go.mod h1:j1iMMHi/sqAHeG5z+O9BFNCF698a1u0186zkjMZQ28w=
k8s.io/client-go v0.32.2 h1:4dYCD4Nz+9RApM2b/3BtVvBHw54QjMFUl1OLcJG5yOA=
k8s.io/client-go v0.32.2/go.mod h1:fpZ4oJXclZ3r2nDOv+Ux3XcJutfrwjKTCHz2H3sww94=
k8s.io/component-base v0.32.2 h1:1aUL5Vdmu7qNo4ZsE+569PV5zFatM9hl+lb3dEea2zU=
k8s.io/component-base v0.32.2/go.mod h1:PXJ61Vx9Lg+P5mS8TLd7bCIr+eMJRQTyXe8KvkrvJq0=
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
k8s.io/kube-openapi v0.0.0-20241212222426-2c72e554b1e7 h1:hcha5B1kVACrLujCKLbr8XWMxCxzQx42DY8QKYJrDLg=
Expand All @@ -589,8 +589,8 @@ k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 h1:M3sRQVHv7vB20Xc2ybTt7ODCeFj6J
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.0 h1:CPT0ExVicCzcpeN4baWEV2ko2Z/AsiZgEdwgcfwLgMo=
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.0/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw=
sigs.k8s.io/controller-runtime v0.20.1 h1:JbGMAG/X94NeM3xvjenVUaBjy6Ui4Ogd/J5ZtjZnHaE=
sigs.k8s.io/controller-runtime v0.20.1/go.mod h1:BrP3w158MwvB3ZbNpaAcIKkHQ7YGpYnzpoSTZ8E14WU=
sigs.k8s.io/controller-runtime v0.20.2 h1:/439OZVxoEc02psi1h4QO3bHzTgu49bb347Xp4gW1pc=
sigs.k8s.io/controller-runtime v0.20.2/go.mod h1:xg2XB0K5ShQzAgsoujxuKN4LNXR2LfwwHsPj7Iaw+XY=
sigs.k8s.io/e2e-framework v0.6.0 h1:p7hFzHnLKO7eNsWGI2AbC1Mo2IYxidg49BiT4njxkrM=
sigs.k8s.io/e2e-framework v0.6.0/go.mod h1:IREnCHnKgRCioLRmNi0hxSJ1kJ+aAdjEKK/gokcZu4k=
sigs.k8s.io/gateway-api v1.2.1 h1:fZZ/+RyRb+Y5tGkwxFKuYuSRQHu9dZtbjenblleOLHM=
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/rootcmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,5 @@ func Run(ctx context.Context, c managercfg.Config, output io.Writer) error {
logger.Info("Anonymous reports disabled, skipping")
}

return m.Run(ctx)
return m.Start(ctx)
}
2 changes: 1 addition & 1 deletion internal/controllers/utils/control_plane_reference.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/predicate"

kongv1alpha1 "github.com/kong/kubernetes-configuration/api/configuration/v1alpha1"
kongv1alpha1 "github.com/kong/kubernetes-configuration/api/common/v1alpha1"
)

// ObjectWithControlPlaneRef is an interface that represents an object that has a control plane reference.
Expand Down
11 changes: 6 additions & 5 deletions internal/controllers/utils/control_plane_reference_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package utils_test
import (
"testing"

kongcommonv1alpha1 "github.com/kong/kubernetes-configuration/api/common/v1alpha1"
"github.com/samber/lo"
"github.com/stretchr/testify/require"
"sigs.k8s.io/controller-runtime/pkg/client"
Expand All @@ -15,10 +16,10 @@ import (

type objectWithCPRefType struct {
client.Object
cpRef *kongv1alpha1.ControlPlaneRef
cpRef *kongcommonv1alpha1.ControlPlaneRef
}

func (o *objectWithCPRefType) GetControlPlaneRef() *kongv1alpha1.ControlPlaneRef {
func (o *objectWithCPRefType) GetControlPlaneRef() *kongcommonv1alpha1.ControlPlaneRef {
return o.cpRef
}

Expand All @@ -38,7 +39,7 @@ func TestGenerateCPReferenceMatchesPredicate(t *testing.T) {
{
name: "control plane reference is set to kic",
obj: objectWithCPRefType{
cpRef: &kongv1alpha1.ControlPlaneRef{
cpRef: &kongcommonv1alpha1.ControlPlaneRef{
Type: kongv1alpha1.ControlPlaneRefKIC,
},
},
Expand All @@ -47,7 +48,7 @@ func TestGenerateCPReferenceMatchesPredicate(t *testing.T) {
{
name: "control plane reference is set to konnect",
obj: objectWithCPRefType{
cpRef: &kongv1alpha1.ControlPlaneRef{
cpRef: &kongcommonv1alpha1.ControlPlaneRef{
Type: kongv1alpha1.ControlPlaneRefKonnectID,
KonnectID: lo.ToPtr("konnect-id"),
},
Expand All @@ -57,7 +58,7 @@ func TestGenerateCPReferenceMatchesPredicate(t *testing.T) {
{
name: "control plane reference is set to konnect namespaced reference",
obj: objectWithCPRefType{
cpRef: &kongv1alpha1.ControlPlaneRef{
cpRef: &kongcommonv1alpha1.ControlPlaneRef{
Type: kongv1alpha1.ControlPlaneRefKonnectNamespacedRef,
KonnectNamespacedRef: &kongv1alpha1.KonnectNamespacedRef{
Name: "konnect-name",
Expand Down
2 changes: 1 addition & 1 deletion internal/manager/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ func AdminAPIClientFromServiceDiscovery(
// configuration validation and sending code.
retryOpts = append([]retry.Option{
retry.Context(ctx),
retry.Attempts(0),
retry.Attempts(1),
retry.DelayType(retry.FixedDelay),
retry.Delay(delay),
retry.OnRetry(func(_ uint, err error) {
Expand Down
4 changes: 2 additions & 2 deletions pkg/manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ func NewManager(ctx context.Context, id ID, logger logr.Logger, cfg managercfg.C
}, nil
}

// Run starts the Kong Ingress Controller. It blocks until the context is cancelled.
// Start starts the Kong Ingress Controller. It blocks until the context is cancelled.
// It should be called only once per Manager instance.
func (m *Manager) Run(ctx context.Context) error {
func (m *Manager) Start(ctx context.Context) error {
return m.manager.Run(ctx)
}

Expand Down
6 changes: 3 additions & 3 deletions pkg/manager/multiinstance/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ func (i *instance) StopChannel() <-chan struct{} {
return i.stopCh
}

// Run runs the instance in a goroutine and blocks until the instance is stopped or the context is done.
func (i *instance) Run(ctx context.Context) {
// Start runs the instance in a goroutine and blocks until the instance is stopped or the context is done.
func (i *instance) Start(ctx context.Context) {
ctx, cancel := context.WithCancel(ctx)
go func() {
if err := i.in.Run(ctx); err != nil {
if err := i.in.Start(ctx); err != nil {
i.logger.Error(err, "Instance exited with an error")
}
}()
Expand Down
8 changes: 4 additions & 4 deletions pkg/manager/multiinstance/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const (
// needed by the multi-instance manager.
type ManagerInstance interface {
ID() manager.ID
Run(context.Context) error
Start(context.Context) error
IsReady() error
DiagnosticsHandler() http.Handler
}
Expand Down Expand Up @@ -74,8 +74,8 @@ func NewManager(logger logr.Logger, opts ...ManagerOption) *Manager {
return m
}

// Run starts the multi-instance manager and blocks until the context is canceled. It should only be called once.
func (m *Manager) Run(ctx context.Context) error {
// Start starts the multi-instance manager and blocks until the context is canceled. It should only be called once.
func (m *Manager) Start(ctx context.Context) error {
for {
select {
case <-ctx.Done():
Expand Down Expand Up @@ -159,7 +159,7 @@ func (m *Manager) runInstance(ctx context.Context, instanceID manager.ID) {
// Wrap with pprof.Do to add instanceID to the pprof labels. That will make it easier to identify which instance
// is responsible for the CPU consumption.
pprof.Do(ctx, pprof.Labels("instanceID", instanceID.String()), func(ctx context.Context) {
go in.Run(ctx)
go in.Start(ctx)
})

// If diagnostics are enabled, register the instance with the diagnostics exposer.
Expand Down
4 changes: 2 additions & 2 deletions pkg/manager/multiinstance/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func TestManager_Scheduling(t *testing.T) {
t.Run("can run the manager", func(t *testing.T) {
go func() {
close(managerRunning)
require.NoError(t, multiManager.Run(ctx))
require.NoError(t, multiManager.Start(ctx))
}()
})

Expand Down Expand Up @@ -97,7 +97,7 @@ func TestManager_WithDiagnosticsExposer(t *testing.T) {
multiManager := multiinstance.NewManager(testr.New(t), multiinstance.WithDiagnosticsExposer(diagnosticsExposer))

go func() {
require.NoError(t, multiManager.Run(ctx))
require.NoError(t, multiManager.Start(ctx))
}()

instanceID1 := manager.NewRandomID()
Expand Down
2 changes: 1 addition & 1 deletion pkg/manager/multiinstance/mocks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func (m *mockInstance) ID() manager.ID {
return m.id
}

func (m *mockInstance) Run(ctx context.Context) error {
func (m *mockInstance) Start(ctx context.Context) error {
m.wasStarted.Store(true)

go func() {
Expand Down
9 changes: 8 additions & 1 deletion scripts/generate-crd-kustomize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@ set -o pipefail
REPO_ROOT=$(dirname ${BASH_SOURCE})/..

KCONF_PACKAGE="github.com/kong/kubernetes-configuration"
KCONF_VERSION=$(go list -m -f '{{ .Version }}' ${KCONF_PACKAGE})
RAW_VERSION=$(go list -m -f '{{ .Version }}' ${KCONF_PACKAGE})
if [[ $(echo "${RAW_VERSION}" | tr -cd '-' | wc -c) -ge 2 ]]; then
# If there are 2 or more hyphens, extract the part after the last hyphen as
# that's a git commit hash (e.g. `v1.1.1-0.20250217181409-44e5ddce290d`).
KCONF_VERSION=$(echo "${RAW_VERSION}" | rev | cut -d'-' -f1 | rev)
else
KCONF_VERSION="ref=${RAW_VERSION}"
fi

generate_kustomization_file() {
local file_path=$1
Expand Down
2 changes: 1 addition & 1 deletion test/envtest/crds_envtest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func TestNoKongCRDsInstalledIsFatal(t *testing.T) {
m, err := manager.NewManager(ctx, id, logger, cfg)
require.NoError(t, err)

require.ErrorContains(t, m.Run(ctx), "timed out waiting for cache to be synced")
require.ErrorContains(t, m.Start(ctx), "timed out waiting for cache to be synced")
}

func TestCRDValidations(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion test/envtest/manager_envtest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func TestManager_NoLeakedGoroutinesAfterContextCancellation(t *testing.T) {
WithAdmissionWebhookEnabled(webhookKey, webhookCert, webhookServerPort),
)
go func() {
err := m.Run(ctx)
err := m.Start(ctx)
require.NoError(t, err)
}()

Expand Down
4 changes: 2 additions & 2 deletions test/envtest/multiinstance_manager_diagnostics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func TestMultiInstanceManagerDiagnostics(t *testing.T) {
}()
multimgr := multiinstance.NewManager(testr.New(t), multiinstance.WithDiagnosticsExposer(diagServer))
go func() {
require.NoError(t, multimgr.Run(ctx))
require.NoError(t, multimgr.Start(ctx))
}()

t.Log("Setting up two instances of the manager and scheduling them in the multi-instance manager")
Expand Down Expand Up @@ -92,7 +92,7 @@ func TestMultiInstanceManager_Profiling(t *testing.T) {
}()
multimgr := multiinstance.NewManager(testr.New(t), multiinstance.WithDiagnosticsExposer(diagServer))
go func() {
require.NoError(t, multimgr.Run(ctx))
require.NoError(t, multimgr.Start(ctx))
}()

m1 := SetupManager(ctx, t, lo.Must(manager.NewID("cp-1")), envcfg, AdminAPIOptFns(), WithDiagnosticsWithoutServer())
Expand Down
2 changes: 1 addition & 1 deletion test/envtest/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ func RunManager(
defer wg.Done()

mgr := SetupManager(ctx, t, mgrID, envcfg, adminAPIOpts, modifyCfgFns...)
require.NoError(t, mgr.Run(ctx))
require.NoError(t, mgr.Start(ctx))
}()
t.Cleanup(func() {
wg.Wait()
Expand Down
2 changes: 1 addition & 1 deletion test/util/controller_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func DeployControllerManagerForCluster(
fmt.Fprintf(os.Stderr, "ERROR: Problems with set up of Controller Manager: %s\n", err)
os.Exit(1)
}
if err := m.Run(ctx); err != nil {
if err := m.Start(ctx); err != nil {
fmt.Fprintf(os.Stderr, "ERROR: Problems with running Controller Manager: %s\n", err)
os.Exit(1)
}
Expand Down

0 comments on commit 0e034cd

Please sign in to comment.