Skip to content
Closed
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 .ci-operator.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
build_root_image:
name: tools
namespace: openstack-k8s-operators
tag: ci-build-root-golang-1.21-sdk-1.31
tag: ci-build-root-golang-1.22-sdk-1.31
2 changes: 1 addition & 1 deletion .github/workflows/build-openstack-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
uses: openstack-k8s-operators/openstack-k8s-operators-ci/.github/workflows/reusable-build-operator.yaml@main
with:
operator_name: openstack
go_version: 1.21.x
go_version: 1.22.x
operator_sdk_version: 1.31.0
bundle_dockerfile: ./bundle.Dockerfile
secrets:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.21.x
go-version: 1.22.x
- uses: actions/checkout@v4
with:
# this fetches all branches. Needed because we need gh-pages branch for deploy to work
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/kustom.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.21.x
go-version: 1.22.x
- uses: actions/checkout@v4
with:
# this fetches all branches. Needed because we need gh-pages branch for deploy to work
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ repos:
entry: bashate --error . --ignore=E006,E040,E011,E020,E012

- repo: https://github.com/golangci/golangci-lint
rev: v1.59.1
rev: v1.63.4
hooks:
- id: golangci-lint-full
args: ["-v"]
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG GOLANG_BUILDER=registry.access.redhat.com/ubi9/go-toolset:1.21
ARG GOLANG_BUILDER=registry.access.redhat.com/ubi9/go-toolset:1.22
ARG OPERATOR_BASE_IMAGE=registry.access.redhat.com/ubi9/ubi-minimal:latest
# Build the manager binary
FROM $GOLANG_BUILDER AS builder
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ tidy: ## Run go mod tidy on every mod file in the repo

.PHONY: golangci-lint
golangci-lint:
test -s $(LOCALBIN)/golangci-lint || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.59.1
test -s $(LOCALBIN)/golangci-lint || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.63.4
$(LOCALBIN)/golangci-lint run --fix

MAX_PROCS := 5
Expand Down Expand Up @@ -306,8 +306,8 @@ KUSTOMIZE_VERSION ?= v5.5.0 #(dprince: bumped to aquire new features like --load
CONTROLLER_TOOLS_VERSION ?= v0.14.0
CRD_MARKDOWN_VERSION ?= v0.0.3
KUTTL_VERSION ?= 0.17.0
GOTOOLCHAIN_VERSION ?= go1.21.0
OC_VERSION ?= 4.14.0
GOTOOLCHAIN_VERSION ?= go1.22.0
OC_VERSION ?= 4.16.0

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4.18 not yet available

wget https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/4.18.0/openshift-client-linux-4.18.0.tar.gz -O - |\
tar xz)
--2025-04-23 08:46:54--  https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/4.18.0/openshift-client-linux-4.18.0.tar.gz
Resolving mirror.openshift.com (mirror.openshift.com)... 3.167.56.39, 3.167.56.96, 3.167.56.87, ...
Connecting to mirror.openshift.com (mirror.openshift.com)|3.167.56.39|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2025-04-23 08:46:54 ERROR 404: Not Found.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we just leave OC_VERSION at 4.16 here? We do still support running on that version...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was 4.14, I bumped it to 4.16. but I think I'll move this to a separate PR. its not really related to the golang bump.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved to #1431


KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
.PHONY: kustomize
Expand Down
2 changes: 1 addition & 1 deletion apis/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/openstack-k8s-operators/openstack-operator/apis

go 1.21
go 1.22

require (
github.com/cert-manager/cert-manager v1.14.7
Expand Down
3 changes: 2 additions & 1 deletion controllers/client/openstackclient_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,8 @@ func (r *OpenStackClientReconciler) Reconcile(ctx context.Context, req ctrl.Requ
condition.TLSInputReadyCondition,
condition.RequestedReason,
condition.SeverityInfo,
fmt.Sprintf(condition.TLSInputReadyWaitingMessage, instance.Spec.CaBundleSecretName)))
condition.TLSInputReadyWaitingMessage,
instance.Spec.CaBundleSecretName))
return ctrl.Result{}, nil
}
instance.Status.Conditions.Set(condition.FalseCondition(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ func (r *OpenStackDataPlaneDeploymentReconciler) Reconcile(ctx context.Context,
severity,
condition.DeploymentReadyErrorMessage,
deploymentErrMsg)
return ctrl.Result{}, fmt.Errorf(deploymentErrMsg)
return ctrl.Result{}, fmt.Errorf("%s", deploymentErrMsg)
}

if shouldRequeue {
Expand Down
8 changes: 4 additions & 4 deletions controllers/dataplane/openstackdataplanenodeset_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ package dataplane
import (
"context"
"fmt"
"slices"
"strings"
"time"

"github.com/go-playground/validator/v10"
"golang.org/x/exp/slices"
batchv1 "k8s.io/api/batch/v1"
corev1 "k8s.io/api/core/v1"
rbacv1 "k8s.io/api/rbac/v1"
Expand Down Expand Up @@ -276,7 +276,7 @@ func (r *OpenStackDataPlaneNodeSetReconciler) Reconcile(ctx context.Context, req
condition.InputReadyCondition,
condition.RequestedReason,
condition.SeverityError,
err.Error())
"%s", err.Error())
return result, err
} else if (result != ctrl.Result{}) {
instance.Status.Conditions.MarkFalse(
Expand Down Expand Up @@ -455,7 +455,7 @@ func (r *OpenStackDataPlaneNodeSetReconciler) Reconcile(ctx context.Context, req
}
instance.Status.Conditions.MarkFalse(condition.DeploymentReadyCondition,
condition.ErrorReason, condition.SeverityError,
deployErrorMsg)
"%s", deployErrorMsg)
}

return ctrl.Result{}, err
Expand Down Expand Up @@ -505,7 +505,7 @@ func checkDeployment(ctx context.Context, helper *helper.Helper,
instance.Status.DeploymentStatuses[deployment.Name] = deploymentConditions
deploymentCondition := deploymentConditions.Get(dataplanev1.NodeSetDeploymentReadyCondition)
if condition.IsError(deploymentCondition) {
err = fmt.Errorf(deploymentCondition.Message)
err = fmt.Errorf("%s", deploymentCondition.Message)
isDeploymentFailed = true
failedDeploymentName = deployment.Name
break
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/openstack-k8s-operators/openstack-operator

go 1.21
go 1.22

require (
github.com/cert-manager/cert-manager v1.14.7
Expand Down Expand Up @@ -41,7 +41,6 @@ require (
github.com/pkg/errors v0.9.1
github.com/rabbitmq/cluster-operator/v2 v2.11.0
go.uber.org/zap v1.27.0
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56
gopkg.in/yaml.v3 v3.0.1
k8s.io/api v0.29.15
k8s.io/apimachinery v0.29.15
Expand Down Expand Up @@ -94,6 +93,7 @@ require (
github.com/spf13/pflag v1.0.6 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.33.0 // indirect
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
golang.org/x/mod v0.20.0 // indirect
golang.org/x/net v0.34.0 // indirect
golang.org/x/oauth2 v0.18.0 // indirect
Expand Down
3 changes: 1 addition & 2 deletions pkg/dataplane/cert.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@ import (
"crypto/sha256"
"encoding/hex"
"fmt"
"slices"
"sort"
"strconv"
"strings"
"time"

"golang.org/x/exp/slices"

corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
apimachineryvalidation "k8s.io/apimachinery/pkg/util/validation"
Expand Down
10 changes: 5 additions & 5 deletions pkg/dataplane/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ import (
"fmt"
"path"
"reflect"
"slices"
"sort"
"strconv"

batchv1 "k8s.io/api/batch/v1"
corev1 "k8s.io/api/core/v1"

slices "golang.org/x/exp/slices"
k8s_errors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/types"
apimachineryvalidation "k8s.io/apimachinery/pkg/util/validation"
Expand Down Expand Up @@ -207,7 +207,7 @@ func (d *Deployer) ConditionalDeploy(
readyCondition,
condition.RequestedReason,
condition.SeverityInfo,
readyWaitingMessage))
"%s", readyWaitingMessage))

}

Expand All @@ -234,7 +234,7 @@ func (d *Deployer) ConditionalDeploy(
log.Info(fmt.Sprintf("Condition %s ready", readyCondition))
nsConditions.Set(condition.TrueCondition(
readyCondition,
readyMessage))
"%s", readyMessage))
} else if ansibleJob.Status.Failed > *ansibleJob.Spec.BackoffLimit {
errorMsg := fmt.Sprintf("execution.name %s execution.namespace %s failed pods: %d", ansibleJob.Name, ansibleJob.Namespace, ansibleJob.Status.Failed)
for _, condition := range ansibleJob.Status.Conditions {
Expand All @@ -246,7 +246,7 @@ func (d *Deployer) ConditionalDeploy(
errorMsg = fmt.Sprintf("backoff limit reached for execution.name %s execution.namespace %s execution.condition.message: %s", ansibleJob.Name, ansibleJob.Namespace, ansibleCondition.Message)
}
log.Info(fmt.Sprintf("Condition %s error", readyCondition))
err = fmt.Errorf(errorMsg)
err = fmt.Errorf("%s", errorMsg)
nsConditions.Set(condition.FalseCondition(
readyCondition,
condition.Reason(ansibleCondition.Reason),
Expand All @@ -259,7 +259,7 @@ func (d *Deployer) ConditionalDeploy(
readyCondition,
condition.RequestedReason,
condition.SeverityInfo,
readyWaitingMessage))
"%s", readyWaitingMessage))
}
}
d.Status.NodeSetConditions[d.NodeSet.Name] = nsConditions
Expand Down
8 changes: 4 additions & 4 deletions pkg/dataplane/ipam.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ func EnsureDNSData(ctx context.Context, helper *helper.Helper,
instance.Status.Conditions.MarkFalse(
dataplanev1.NodeSetDNSDataReadyCondition,
condition.ErrorReason, condition.SeverityError,
err.Error())
"%s", err.Error())
return dnsDetails, err
}
if dnsDetails.ClusterAddresses == nil {
Expand Down Expand Up @@ -348,7 +348,7 @@ func reserveIPs(ctx context.Context, helper *helper.Helper,
if len(netConfigList.Items) == 0 {
errMsg := "no NetConfig CR exists yet"
util.LogForObject(helper, errMsg, instance)
return nil, nil, fmt.Errorf(errMsg)
return nil, nil, fmt.Errorf("%s", errMsg)
}
netServiceNetMap := BuildNetServiceNetMap(netConfigList.Items[0])
allIPSets := make(map[string]infranetworkv1.IPSet)
Expand All @@ -371,7 +371,7 @@ func reserveIPs(ctx context.Context, helper *helper.Helper,
}
if !foundCtlPlane {
msg := fmt.Sprintf("ctlplane network should be defined for node %s", nodeName)
return nil, netServiceNetMap, fmt.Errorf(msg)
return nil, netServiceNetMap, fmt.Errorf("%s", msg)
}
ipSet := &infranetworkv1.IPSet{
ObjectMeta: metav1.ObjectMeta{
Expand All @@ -395,7 +395,7 @@ func reserveIPs(ctx context.Context, helper *helper.Helper,
} else {
msg := fmt.Sprintf("No Networks defined for node %s or template", nodeName)
util.LogForObject(helper, msg, instance)
return nil, netServiceNetMap, fmt.Errorf(msg)
return nil, netServiceNetMap, fmt.Errorf("%s", msg)
}
}
return allIPSets, netServiceNetMap, nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/dataplane/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import (
"fmt"
"os"
"path"
"slices"
"strings"

"golang.org/x/exp/slices"
yaml "gopkg.in/yaml.v3"
k8s_errors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
2 changes: 1 addition & 1 deletion pkg/dataplane/util/ansibleee.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func (a *EEJob) JobForOpenStackAnsibleEE(h *helper.Helper) (*batchv1.Job, error)
}},
}

if a.NodeSelector != nil && len(a.NodeSelector) > 0 {
if len(a.NodeSelector) > 0 {
podSpec.NodeSelector = a.NodeSelector
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/openstack/ca.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"fmt"
"math"
"os"
"slices"
"time"

certmgrv1 "github.com/cert-manager/cert-manager/pkg/apis/certmanager/v1"
Expand All @@ -19,7 +20,6 @@ import (
"github.com/openstack-k8s-operators/lib-common/modules/common/secret"
"github.com/openstack-k8s-operators/lib-common/modules/common/tls"
"github.com/openstack-k8s-operators/lib-common/modules/common/util"
"golang.org/x/exp/slices"
k8s_errors "k8s.io/apimachinery/pkg/api/errors"

corev1 "github.com/openstack-k8s-operators/openstack-operator/apis/core/v1beta1"
Expand Down
2 changes: 1 addition & 1 deletion pkg/openstack/galera.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func ReconcileGaleras(
corev1beta1.OpenStackControlPlaneMariaDBReadyErrorMessage,
errors))

return ctrl.Result{}, fmt.Errorf(errors)
return ctrl.Result{}, fmt.Errorf("%s", errors)

} else if len(inprogress) > 0 {
log.Info("Galera in progress")
Expand Down
2 changes: 1 addition & 1 deletion pkg/openstack/memcached.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func ReconcileMemcacheds(
corev1beta1.OpenStackControlPlaneMemcachedReadyErrorMessage,
errors))

return ctrlResult, fmt.Errorf(errors)
return ctrlResult, fmt.Errorf("%s", errors)

} else if len(inprogress) > 0 {
instance.Status.Conditions.Set(condition.FalseCondition(
Expand Down
4 changes: 2 additions & 2 deletions pkg/openstack/rabbitmq.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func ReconcileRabbitMQs(
corev1beta1.OpenStackControlPlaneRabbitMQReadyErrorMessage,
errors))

return ctrl.Result{}, fmt.Errorf(errors)
return ctrl.Result{}, fmt.Errorf("%s", errors)

} else if len(inprogress) > 0 {
instance.Status.Conditions.Set(condition.FalseCondition(
Expand Down Expand Up @@ -259,7 +259,7 @@ func reconcileRabbitMQ(
op, err := controllerutil.CreateOrPatch(ctx, helper.GetClient(), rabbitmq, func() error {
spec.DeepCopyInto(&rabbitmq.Spec.RabbitMqSpecCore)
if rabbitmq.Spec.Persistence.StorageClassName == nil {
log.Info(fmt.Sprintf("Setting StorageClassName: " + instance.Spec.StorageClass))
log.Info(fmt.Sprintf("Setting StorageClassName: %s", instance.Spec.StorageClass))
rabbitmq.Spec.Persistence.StorageClassName = &instance.Spec.StorageClass
}
if tlsCert != "" {
Expand Down
2 changes: 1 addition & 1 deletion pkg/openstack/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func ReconcileRedis(
corev1beta1.OpenStackControlPlaneRedisReadyErrorMessage,
errors))

return ctrlResult, fmt.Errorf(errors)
return ctrlResult, fmt.Errorf("%s", errors)

} else if len(inprogress) > 0 {
instance.Status.Conditions.Set(condition.FalseCondition(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1327,8 +1327,8 @@ var _ = Describe("Dataplane NodeSet Test", func() {
const bootstrapName string = "bootstrap"
// Make an AnsibleEE name for each service
ansibleeeName := types.NamespacedName{
Name: fmt.Sprintf(
bootstrapName + "-" + dataplaneDeploymentName.Name + "-" + dataplaneNodeSetName.Name),
Name: fmt.Sprintf("%s-%s-%s",
bootstrapName, dataplaneDeploymentName.Name, dataplaneNodeSetName.Name),
Namespace: namespace,
}
ansibleEE := GetAnsibleee(ansibleeeName)
Expand Down Expand Up @@ -1394,8 +1394,8 @@ var _ = Describe("Dataplane NodeSet Test", func() {
const bootstrapName string = "bootstrap"
// Make an AnsibleEE name for each service
ansibleeeName := types.NamespacedName{
Name: fmt.Sprintf(
bootstrapName + "-" + dataplaneDeploymentName.Name + "-" + dataplaneNodeSetName.Name),
Name: fmt.Sprintf("%s-%s-%s",
bootstrapName, dataplaneDeploymentName.Name, dataplaneNodeSetName.Name),
Namespace: namespace,
}
ansibleEE := GetAnsibleee(ansibleeeName)
Expand Down
4 changes: 2 additions & 2 deletions zuul.d/jobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
parent: podified-multinode-edpm-deployment-crc-3comp
dependencies: ["openstack-k8s-operators-content-provider"]
vars:
cifmw_operator_build_golang_ct: "docker.io/library/golang:1.21"
cifmw_operator_build_golang_alt_ct: "quay.rdoproject.org/openstack-k8s-operators/golang:1.21"
cifmw_operator_build_golang_ct: "docker.io/library/golang:1.22"
cifmw_operator_build_golang_alt_ct: "quay.rdoproject.org/openstack-k8s-operators/golang:1.22"
cifmw_tempest_tempestconf_config:
# NOTE(alee) these tests will fail with barbican in the mix
# while cinder/nova is not configured to talk to barbican
Expand Down