Skip to content
Open
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
7 changes: 3 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/InseeFrLab/s3-operator
go 1.25.0

require (
github.com/minio/madmin-go/v4 v4.10.0
github.com/minio/madmin-go/v3 v3.0.110
github.com/minio/minio-go/v7 v7.0.97
github.com/onsi/ginkgo/v2 v2.27.3
github.com/onsi/gomega v1.38.3
Expand Down Expand Up @@ -33,7 +33,6 @@ require (
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/ebitengine/purego v0.8.4 // indirect
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
github.com/evanphx/json-patch/v5 v5.9.11 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
Expand Down Expand Up @@ -65,7 +64,6 @@ require (
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/minio/crc64nvme v1.1.0 // indirect
github.com/minio/md5-simd v1.1.2 // indirect
github.com/minio/pkg/v3 v3.4.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
Expand All @@ -80,7 +78,8 @@ require (
github.com/rs/xid v1.6.0 // indirect
github.com/safchain/ethtool v0.6.1 // indirect
github.com/secure-io/sio-go v0.3.1 // indirect
github.com/shirou/gopsutil/v4 v4.25.5 // indirect
github.com/shirou/gopsutil/v3 v3.24.5 // indirect
github.com/shoenig/go-m1cpu v0.1.6 // indirect
github.com/spf13/cobra v1.10.2 // indirect
github.com/spf13/pflag v1.0.10 // indirect
github.com/stoewer/go-strcase v1.3.0 // indirect
Expand Down
18 changes: 8 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/ebitengine/purego v0.8.4 h1:CF7LEKg5FFOsASUj0+QwaXf8Ht6TlFxg09+S9wz0omw=
github.com/ebitengine/purego v0.8.4/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ=
github.com/emicklei/go-restful/v3 v3.12.2 h1:DhwDP0vY3k8ZzE0RunuJy8GhNpPL6zqLkDf9B/a0/xU=
github.com/emicklei/go-restful/v3 v3.12.2/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
github.com/evanphx/json-patch v0.5.2 h1:xVCHIVMUu1wtM/VkR9jVZ45N3FhZfYMMYGorLCR8P3k=
Expand Down Expand Up @@ -116,16 +114,12 @@ github.com/mfridman/tparse v0.18.0 h1:wh6dzOKaIwkUGyKgOntDW4liXSo37qg5AXbIhkMV3v
github.com/mfridman/tparse v0.18.0/go.mod h1:gEvqZTuCgEhPbYk/2lS3Kcxg1GmTxxU7kTC8DvP0i/A=
github.com/minio/crc64nvme v1.1.0 h1:e/tAguZ+4cw32D+IO/8GSf5UVr9y+3eJcxZI2WOO/7Q=
github.com/minio/crc64nvme v1.1.0/go.mod h1:eVfm2fAzLlxMdUGc0EEBGSMmPwmXD5XiNRpnu9J3bvg=
github.com/minio/madmin-go/v4 v4.6.0 h1:wJa//JX+GhghPqRiMsrU1tIUO8NGPnBEZtoUFSV/ZbQ=
github.com/minio/madmin-go/v4 v4.6.0/go.mod h1:dzLgRjfo2JOOcDsTt6FGFPuyzMR/4KSZcUVEbxUlSmw=
github.com/minio/madmin-go/v4 v4.10.0 h1:sa3Gqg5EGTixN0eCEJwSsmWFIwxd449sNw60CaafX6E=
github.com/minio/madmin-go/v4 v4.10.0/go.mod h1:x0dnglymF0va4vh4qJ/dU8Pf+kSCIfR8TL2xyRNIEgY=
github.com/minio/madmin-go/v3 v3.0.110 h1:FIYekj7YPc430ffpXFWiUtyut3qBt/unIAcDzJn9H5M=
github.com/minio/madmin-go/v3 v3.0.110/go.mod h1:WOe2kYmYl1OIlY2DSRHVQ8j1v4OItARQ6jGyQqcCud8=
github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34=
github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM=
github.com/minio/minio-go/v7 v7.0.97 h1:lqhREPyfgHTB/ciX8k2r8k0D93WaFqxbJX36UZq5occ=
github.com/minio/minio-go/v7 v7.0.97/go.mod h1:re5VXuo0pwEtoNLsNuSr0RrLfT/MBtohwdaSmPPSRSk=
github.com/minio/pkg/v3 v3.4.0 h1:Jryq7huJHEEr02hxjJHXxIBxAEFSdJ64hmjw/ucYuIo=
github.com/minio/pkg/v3 v3.4.0/go.mod h1:Iv4ytZUZbcjIxjU57C7TbD7tgJo/5zXQYhFI+kCHQRQ=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
Expand Down Expand Up @@ -168,8 +162,12 @@ github.com/safchain/ethtool v0.6.1 h1:mhRnXE1H8fV8TTXh/HdqE4tXtb57r//BQh5pPYMuM5
github.com/safchain/ethtool v0.6.1/go.mod h1:JzoNbG8xeg/BeVeVoMCtCb3UPWoppZZbFpA+1WFh+M0=
github.com/secure-io/sio-go v0.3.1 h1:dNvY9awjabXTYGsTF1PiCySl9Ltofk9GA3VdWlo7rRc=
github.com/secure-io/sio-go v0.3.1/go.mod h1:+xbkjDzPjwh4Axd07pRKSNriS9SCiYksWnZqdnfpQxs=
github.com/shirou/gopsutil/v4 v4.25.5 h1:rtd9piuSMGeU8g1RMXjZs9y9luK5BwtnG7dZaQUJAsc=
github.com/shirou/gopsutil/v4 v4.25.5/go.mod h1:PfybzyydfZcN+JMMjkF6Zb8Mq1A/VcogFFg7hj50W9c=
github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI=
github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk=
github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM=
github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ=
github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU=
github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k=
github.com/spf13/cobra v1.10.2 h1:DMTTonx5m65Ic0GOoRY2c16WCbHxOOw6xxezuLaBpcU=
github.com/spf13/cobra v1.10.2/go.mod h1:7C1pvHqHw5A4vrJfjNwvOdzYu0Gml16OCs2GRiTUUS4=
github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
Expand Down
2 changes: 1 addition & 1 deletion internal/controller/policy/reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/reconcile"

s3v1alpha1 "github.com/InseeFrLab/s3-operator/api/v1alpha1"
"github.com/minio/madmin-go/v4"
"github.com/minio/madmin-go/v3"
)

// Reconcile is part of the main kubernetes reconciliation loop which aims to
Expand Down
8 changes: 4 additions & 4 deletions internal/s3/client/impl/minioS3Client.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"strings"

s3client "github.com/InseeFrLab/s3-operator/internal/s3/client"
"github.com/minio/madmin-go/v4"
"github.com/minio/madmin-go/v3"
"github.com/minio/minio-go/v7"
"github.com/minio/minio-go/v7/pkg/credentials"
ctrl "sigs.k8s.io/controller-runtime"
Expand Down Expand Up @@ -301,7 +301,7 @@ func (minioS3Client *MinioS3Client) GetQuota(name string) (int64, error) {
if err != nil {
s3Logger.Error(err, "error while getting quota on bucket", "bucket", name)
}
return int64(bucketQuota.Size), err
return int64(bucketQuota.Quota), err
}

func (minioS3Client *MinioS3Client) SetQuota(name string, quota int64) error {
Expand All @@ -310,7 +310,7 @@ func (minioS3Client *MinioS3Client) SetQuota(name string, quota int64) error {
err := minioS3Client.adminClient.SetBucketQuota(
context.Background(),
name,
&madmin.BucketQuota{Size: uint64(quota), Type: madmin.HardQuota},
&madmin.BucketQuota{Quota: uint64(quota), Type: madmin.HardQuota},
)
return err
}
Expand All @@ -333,7 +333,7 @@ func (minioS3Client *MinioS3Client) GetPolicyInfo(name string) (*madmin.PolicyIn
s3Logger := ctrl.Log.WithValues("logger", "s3clientimplminio")
s3Logger.Info("retrieving policy info", "policy", name)

policy, err := minioS3Client.adminClient.InfoCannedPolicy(context.Background(), name)
policy, err := minioS3Client.adminClient.InfoCannedPolicyV2(context.Background(), name)
if err != nil {
// Not ideal (breaks if error nomenclature changes), but still
// better than testing the error message as we did before
Expand Down
2 changes: 1 addition & 1 deletion internal/s3/client/impl/mockedS3Client.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package s3clientimpl

import (
s3client "github.com/InseeFrLab/s3-operator/internal/s3/client"
"github.com/minio/madmin-go/v4"
"github.com/minio/madmin-go/v3"
ctrl "sigs.k8s.io/controller-runtime"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/s3/client/s3client.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
package s3client

import (
"github.com/minio/madmin-go/v4"
"github.com/minio/madmin-go/v3"
)

type S3Config struct {
Expand Down
2 changes: 1 addition & 1 deletion test/mocks/mockedS3Client.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package mocks

import (
s3client "github.com/InseeFrLab/s3-operator/internal/s3/client"
"github.com/minio/madmin-go/v4"
"github.com/minio/madmin-go/v3"
"github.com/stretchr/testify/mock"
ctrl "sigs.k8s.io/controller-runtime"
)
Expand Down
2 changes: 1 addition & 1 deletion test/utils/testUtils.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
s3client "github.com/InseeFrLab/s3-operator/internal/s3/client"
s3factory "github.com/InseeFrLab/s3-operator/internal/s3/factory"
"github.com/InseeFrLab/s3-operator/test/mocks"
"github.com/minio/madmin-go/v4"
"github.com/minio/madmin-go/v3"
"github.com/stretchr/testify/mock"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
Loading