Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ endif
REPO?=tigera/operator
PACKAGE_NAME?=github.com/tigera/operator
LOCAL_USER_ID?=$(shell id -u $$USER)
GO_BUILD_VER?=1.24.13-llvm18.1.8-k8s1.32.11
GO_BUILD_VER?=1.25.9-llvm18.1.8-k8s1.32.13
CALICO_BUILD?=calico/go-build:$(GO_BUILD_VER)-$(BUILDARCH)
SRC_FILES=$(shell find ./pkg -name '*.go')
SRC_FILES+=$(shell find ./api -name '*.go')
Expand Down
10 changes: 2 additions & 8 deletions api/v1/installation_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -806,10 +806,7 @@ func (p *IPPool) FromProjectCalicoV1(crd pcv1.IPPool) {
}

// Configure DisableNewAllocations
disableAlloc := false
if crd.Spec.Disabled {
disableAlloc = true
}
disableAlloc := crd.Spec.Disabled
p.DisableNewAllocations = &disableAlloc

// Set BlockSize
Expand All @@ -820,10 +817,7 @@ func (p *IPPool) FromProjectCalicoV1(crd pcv1.IPPool) {
p.NodeSelector = crd.Spec.NodeSelector

// Set BGP export.
disableExport := false
if crd.Spec.DisableBGPExport {
disableExport = true
}
disableExport := crd.Spec.DisableBGPExport
p.DisableBGPExport = &disableExport

for _, use := range crd.Spec.AllowedUses {
Expand Down
17 changes: 10 additions & 7 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (

v3 "github.com/tigera/api/pkg/apis/projectcalico/v3"

v1 "github.com/tigera/operator/api/v1"
"github.com/tigera/operator/internal/controller"
"github.com/tigera/operator/pkg/active"
"github.com/tigera/operator/pkg/apis"
Expand Down Expand Up @@ -301,7 +300,7 @@ If a value other than 'all' is specified, the first CRD with a prefix of the spe

// Check if we need to do any cleanup.
client := mgr.GetClient()
instance := &v1.Installation{}
instance := &operatortigeraiov1.Installation{}
retries := 0
for {
if err := client.Get(ctx, utils.DefaultInstanceKey, instance); errors.IsNotFound(err) {
Expand Down Expand Up @@ -490,8 +489,12 @@ func setKubernetesServiceEnv(kubeconfigFile string) error {
// The kubernetes in-cluster functions don't let you override the apiserver
// directly; gotta "pass" it via environment vars.
log.Info("Overriding kubernetes api to %s", apiURL)
os.Setenv("KUBERNETES_SERVICE_HOST", url.Hostname())
os.Setenv("KUBERNETES_SERVICE_PORT", url.Port())
if err := os.Setenv("KUBERNETES_SERVICE_HOST", url.Hostname()); err != nil {
return err
}
if err := os.Setenv("KUBERNETES_SERVICE_PORT", url.Port()); err != nil {
return err
}
return nil
}

Expand Down Expand Up @@ -528,7 +531,7 @@ func showCRDs(variant operatortigeraiov1.ProductVariant, outputType string) erro
}
b, err := yaml.Marshal(v)
if err != nil {
return fmt.Errorf("Failed to Marshal %s: %v", v.Name, err)
return fmt.Errorf("failed to marshal %s: %v", v.Name, err)
}
if !first {
fmt.Println("---")
Expand All @@ -540,7 +543,7 @@ func showCRDs(variant operatortigeraiov1.ProductVariant, outputType string) erro
}
// Indicates nothing was printed so we couldn't find the requested outputType
if first {
return fmt.Errorf("No CRD matching %s", outputType)
return fmt.Errorf("no CRD matching %s", outputType)
}

return nil
Expand Down Expand Up @@ -573,7 +576,7 @@ func executePreDeleteHook(ctx context.Context, c client.Client) error {
for {
select {
case <-to:
return fmt.Errorf("Timeout waiting for pre-delete hook")
return fmt.Errorf("timeout waiting for pre-delete hook")
default:
if err := c.Get(ctx, utils.DefaultInstanceKey, installation); errors.IsNotFound(err) {
// It's gone! We can return.
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/tigera/operator

go 1.24.13
go 1.25.9

require (
github.com/aws/aws-sdk-go v1.55.5
Expand Down
4 changes: 2 additions & 2 deletions hack/gen-versions/components.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ func GetComponents(versionsPath string) (Release, error) {
if component.Image == "" {
image := defaultImages[key]
if image == "" {
return cv, fmt.Errorf("no image nor default image available for component '%s'. "+
"Either fill in the 'image' field or update this code with a defaultImage.", key)
return cv, fmt.Errorf("no image nor default image available for component '%s': "+
"either fill in the 'image' field or update this code with a defaultImage", key)
}
component.Image = image
}
Expand Down
4 changes: 2 additions & 2 deletions internal/controller/suite_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2024 Tigera, Inc. All rights reserved.
// Copyright (c) 2024-2026 Tigera, Inc. All rights reserved.
/*

Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -23,7 +23,7 @@ import (
"testing"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
. "github.com/onsi/gomega" //nolint:staticcheck

"k8s.io/client-go/kubernetes/scheme"
"k8s.io/client-go/rest"
Expand Down
4 changes: 2 additions & 2 deletions pkg/active/active_suite_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2019, 2023 Tigera, Inc. All rights reserved.
// Copyright (c) 2019, 2023,2026 Tigera, Inc. All rights reserved.

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -18,7 +18,7 @@ import (
"testing"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/onsi/gomega" //nolint:staticcheck

"github.com/onsi/ginkgo/reporters"
)
Expand Down
4 changes: 2 additions & 2 deletions pkg/active/active_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2021-2024 Tigera, Inc. All rights reserved.
// Copyright (c) 2021-2026 Tigera, Inc. All rights reserved.

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -18,7 +18,7 @@ import (
"context"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/onsi/gomega" //nolint:staticcheck

apps "k8s.io/api/apps/v1"
batchv1 "k8s.io/api/batch/v1"
Expand Down
6 changes: 3 additions & 3 deletions pkg/awssgsetup/aws_security_group_setup.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020-2024 Tigera, Inc. All rights reserved.
// Copyright (c) 2020-2026 Tigera, Inc. All rights reserved.

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -64,7 +64,7 @@ func SetupAWSSecurityGroups(ctx context.Context, client client.Client, hosted bo

meta := ec2metadata.New(metaSess)
if !meta.Available() {
return fmt.Errorf("Instance metadata is not available, unable to configure Security Groups")
return fmt.Errorf("instance metadata is not available, unable to configure Security Groups")
}

doc, err := meta.GetInstanceIdentityDocument()
Expand Down Expand Up @@ -317,7 +317,7 @@ func allowIngressToSG(cli *ec2.EC2, toSG *ec2.SecurityGroup, sources []ingressSr
}})
_, err := cli.AuthorizeSecurityGroupIngress(in)
if err != nil {
return fmt.Errorf("Failed to add to SG '%s' the ingress rule '%s': %v: %v", sgId, s.String(), toSG, err)
return fmt.Errorf("failed to add to SG '%s' the ingress rule '%s': %v: %v", sgId, s.String(), toSG, err)
}
log.V(DEBUG).Info("Added Ingress rule", "toSG.GroupId", sgId, "ingressSrc", s.String())
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/common/autoscale.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020-2024 Tigera, Inc. All rights reserved.
// Copyright (c) 2020-2026 Tigera, Inc. All rights reserved.

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -30,7 +30,7 @@ package common
// ...
// >3600 20
func GetExpectedTyphaScale(nodes int) int {
var maxNodesPerTypha int = 200
var maxNodesPerTypha = 200

// This gives a count of how many 200s so we need 1+ this number to get at least
// 1 typha for every 200 nodes.
Expand Down
4 changes: 2 additions & 2 deletions pkg/common/common_suite_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2021, 2023 Tigera, Inc. All rights reserved.
// Copyright (c) 2021, 2023,2026 Tigera, Inc. All rights reserved.

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -18,7 +18,7 @@ import (
"testing"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/onsi/gomega" //nolint:staticcheck

"github.com/onsi/ginkgo/reporters"
)
Expand Down
6 changes: 3 additions & 3 deletions pkg/common/k8svalidation/helper/helper.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2022-2024 Tigera, Inc. All rights reserved.
// Copyright (c) 2022-2026 Tigera, Inc. All rights reserved.
/*
Copyright 2014 The Kubernetes Authors.

Expand Down Expand Up @@ -56,10 +56,10 @@ var Semantic = conversion.EqualitiesOrDie(
return a.Cmp(b) == 0
},
func(a, b metav1.MicroTime) bool {
return a.UTC() == b.UTC()
return a.UTC().Equal(b.UTC())
},
func(a, b metav1.Time) bool {
return a.UTC() == b.UTC()
return a.UTC().Equal(b.UTC())
},
func(a, b labels.Selector) bool {
return a.String() == b.String()
Expand Down
4 changes: 2 additions & 2 deletions pkg/common/kubernetes_version_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020-2024 Tigera, Inc. All rights reserved.
// Copyright (c) 2020-2026 Tigera, Inc. All rights reserved.

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -24,7 +24,7 @@ import (
"k8s.io/client-go/kubernetes/fake"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/onsi/gomega" //nolint:staticcheck
)

var _ = Describe("Test get Kubernetes version", func() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/common/operator_serviceaccount_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2021-2024 Tigera, Inc. All rights reserved.
// Copyright (c) 2021-2026 Tigera, Inc. All rights reserved.

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -18,7 +18,7 @@ import (
"os"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/onsi/gomega" //nolint:staticcheck
)

var _ = Describe("Operator ServiceAccount name tests", func() {
Expand Down
2 changes: 1 addition & 1 deletion pkg/common/validation/overrides_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (

. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/extensions/table"
. "github.com/onsi/gomega"
. "github.com/onsi/gomega" //nolint:staticcheck
apiserver "github.com/tigera/operator/pkg/common/validation/apiserver"
typha "github.com/tigera/operator/pkg/common/validation/typha"
"github.com/tigera/operator/pkg/render"
Expand Down
4 changes: 2 additions & 2 deletions pkg/common/validation/validation_suite_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2022 - 2023 Tigera, Inc. All rights reserved.
// Copyright (c) 2022 - 2023,2026 Tigera, Inc. All rights reserved.

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -18,7 +18,7 @@ import (
"testing"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/onsi/gomega" //nolint:staticcheck

"github.com/onsi/ginkgo/reporters"
)
Expand Down
4 changes: 2 additions & 2 deletions pkg/components/components_suite_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2019, 2023 Tigera, Inc. All rights reserved.
// Copyright (c) 2019, 2023,2026 Tigera, Inc. All rights reserved.

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -18,7 +18,7 @@ import (
"testing"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/onsi/gomega" //nolint:staticcheck

"github.com/onsi/ginkgo/reporters"
)
Expand Down
4 changes: 2 additions & 2 deletions pkg/components/images_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2019-2024 Tigera, Inc. All rights reserved.
// Copyright (c) 2019-2026 Tigera, Inc. All rights reserved.

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -19,7 +19,7 @@ import (

. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/extensions/table"
. "github.com/onsi/gomega"
. "github.com/onsi/gomega" //nolint:staticcheck

op "github.com/tigera/operator/api/v1"
)
Expand Down
4 changes: 2 additions & 2 deletions pkg/controller/apiserver/apiserver_controller_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020-2024 Tigera, Inc. All rights reserved.
// Copyright (c) 2020-2026 Tigera, Inc. All rights reserved.

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -22,7 +22,7 @@ import (
kerror "k8s.io/apimachinery/pkg/api/errors"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/onsi/gomega" //nolint:staticcheck
"github.com/stretchr/testify/mock"

admregv1 "k8s.io/api/admissionregistration/v1"
Expand Down
4 changes: 2 additions & 2 deletions pkg/controller/apiserver/apiserver_suite_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2019-2024 Tigera, Inc. All rights reserved.
// Copyright (c) 2019-2026 Tigera, Inc. All rights reserved.

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -20,7 +20,7 @@ import (
uzap "go.uber.org/zap"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/onsi/gomega" //nolint:staticcheck

"github.com/onsi/ginkgo/reporters"

Expand Down
14 changes: 7 additions & 7 deletions pkg/controller/applicationlayer/applicationlayer_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,13 +338,13 @@ func (r *ReconcileApplicationLayer) Reconcile(ctx context.Context, request recon
// updateApplicationLayerWithDefaults populates the applicationlayer with defaults.
func updateApplicationLayerWithDefaults(al *operatorv1.ApplicationLayer) {
var (
defaultLogIntervalSeconds int64 = 5
defaultLogRequestsPerInterval int64 = -1
defaultLogCollectionStatusType operatorv1.LogCollectionStatusType = operatorv1.L7LogCollectionDisabled
defaultWebApplicationFirewallStatusType operatorv1.WAFStatusType = operatorv1.WAFDisabled
defaultApplicationLayerPolicyStatusType operatorv1.ApplicationLayerPolicyStatusType = operatorv1.ApplicationLayerPolicyDisabled
defaultSidecarStatusType operatorv1.SidecarStatusType = operatorv1.SidecarDisabled
defaultSidecarWebhookStateType operatorv1.SidecarWebhookStateType = operatorv1.SidecarWebhookStateDisabled
defaultLogIntervalSeconds int64 = 5
defaultLogRequestsPerInterval int64 = -1
defaultLogCollectionStatusType = operatorv1.L7LogCollectionDisabled
defaultWebApplicationFirewallStatusType = operatorv1.WAFDisabled
defaultApplicationLayerPolicyStatusType = operatorv1.ApplicationLayerPolicyDisabled
defaultSidecarStatusType = operatorv1.SidecarDisabled
defaultSidecarWebhookStateType = operatorv1.SidecarWebhookStateDisabled
)

if al.Spec.LogCollection == nil {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2021-2024 Tigera, Inc. All rights reserved.
// Copyright (c) 2021-2026 Tigera, Inc. All rights reserved.

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -19,7 +19,7 @@ import (
"fmt"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/onsi/gomega" //nolint:staticcheck
"github.com/stretchr/testify/mock"

admregv1 "k8s.io/api/admissionregistration/v1"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2021, 2023 Tigera, Inc. All rights reserved.
// Copyright (c) 2021, 2023,2026 Tigera, Inc. All rights reserved.

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -19,7 +19,7 @@ import (

. "github.com/onsi/ginkgo"
"github.com/onsi/ginkgo/reporters"
. "github.com/onsi/gomega"
. "github.com/onsi/gomega" //nolint:staticcheck
)

func TestStatus(t *testing.T) {
Expand Down
Loading