Skip to content

Commit

Permalink
Fix objects for Go 1.21
Browse files Browse the repository at this point in the history
This changes fixes the ResourceRequirements which is now VolumeResourceRequirements,
along with satisfying pre-commit by allocating blank identifiers for unused
function args

Signed-off-by: Brendan Shephard <[email protected]>
  • Loading branch information
bshephar committed Sep 17, 2024
1 parent f2cb5ab commit dc21b12
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
2 changes: 0 additions & 2 deletions api/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ module github.com/openstack-k8s-operators/swift-operator/api

go 1.21

toolchain go1.21.12

require (
github.com/onsi/ginkgo/v2 v2.20.1
github.com/onsi/gomega v1.34.1
Expand Down
2 changes: 1 addition & 1 deletion controllers/swiftproxy_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ func (r *SwiftProxyReconciler) SetupWithManager(mgr ctrl.Manager) error {
return err
}

memcachedFn := func(ctx context.Context, o client.Object) []reconcile.Request {
memcachedFn := func(_ context.Context, o client.Object) []reconcile.Request {
result := []reconcile.Request{}

// get all SwiftProxy CRs
Expand Down
2 changes: 1 addition & 1 deletion controllers/swiftring_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ func (r *SwiftRingReconciler) reconcileDelete(ctx context.Context, instance *swi

// SetupWithManager sets up the controller with the Manager.
func (r *SwiftRingReconciler) SetupWithManager(mgr ctrl.Manager) error {
swiftRingFilter := func(ctx context.Context, o client.Object) []reconcile.Request {
swiftRingFilter := func(_ context.Context, o client.Object) []reconcile.Request {
result := []reconcile.Request{}
swiftRings := &swiftv1beta1.SwiftRingList{}
listOpts := []client.ListOption{client.InNamespace(o.GetNamespace())}
Expand Down
2 changes: 1 addition & 1 deletion controllers/swiftstorage_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ func (r *SwiftStorageReconciler) Reconcile(ctx context.Context, req ctrl.Request
func (r *SwiftStorageReconciler) SetupWithManager(mgr ctrl.Manager) error {
logger := mgr.GetLogger()

memcachedFn := func(ctx context.Context, o client.Object) []reconcile.Request {
memcachedFn := func(_ context.Context, o client.Object) []reconcile.Request {
result := []reconcile.Request{}

// get all SwiftStorage CRs
Expand Down
6 changes: 3 additions & 3 deletions pkg/swiftstorage/statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ func getStorageContainers(swiftstorage *swiftv1beta1.SwiftStorage, env []corev1.
}

func StatefulSet(
swiftstorage *swiftv1beta1.SwiftStorage, labels map[string]string, annotations map[string]string, configHash string) (*appsv1.StatefulSet, error) {

swiftstorage *swiftv1beta1.SwiftStorage, labels map[string]string, annotations map[string]string, configHash string,
) (*appsv1.StatefulSet, error) {
trueVal := true
OnRootMismatch := corev1.FSGroupChangeOnRootMismatch
user := int64(swift.RunAsUser)
Expand Down Expand Up @@ -259,7 +259,7 @@ func StatefulSet(
AccessModes: []corev1.PersistentVolumeAccessMode{
corev1.ReadWriteOnce,
},
Resources: corev1.ResourceRequirements{
Resources: corev1.VolumeResourceRequirements{
Requests: corev1.ResourceList{
corev1.ResourceStorage: pvcSize,
},
Expand Down

0 comments on commit dc21b12

Please sign in to comment.