From e3b1a64d1c83e884069529f3212c10b4f3e9e115 Mon Sep 17 00:00:00 2001 From: Maho Takara Date: Fri, 24 May 2024 07:46:59 +0000 Subject: [PATCH] go k8s api libs 0.29.5 update CRD Remove config.WithRegion() Add environment env AWS_REGION Add AWS_REGION in test case change for review commnet change for gofmt error Revice explanation of AWS S3 edit for review comment fix error fix error of lint resolve conflict check for pd --- .../templates/generated/crds/moco_crds.yaml | 58 +------------------ .../bases/moco.cybozu.com_backuppolicies.yaml | 3 - .../bases/moco.cybozu.com_mysqlclusters.yaml | 52 ----------------- ...nition_backuppolicies.moco.cybozu.com.yaml | 3 - ...inition_mysqlclusters.moco.cybozu.com.yaml | 52 ----------------- docs/usage.md | 9 ++- e2e/testdata/backup.yaml | 2 + e2e/testdata/backup_tls.yaml | 2 + e2e/testdata/backup_with_env.yaml | 2 + e2e/testdata/restore.yaml | 2 + e2e/testdata/restore_tls.yaml | 2 + e2e/testdata/restore_with_env.yaml | 2 + go.mod | 18 +++--- go.sum | 36 ++++++------ pkg/bucket/s3.go | 2 +- pkg/bucket/s3_test.go | 6 +- 16 files changed, 53 insertions(+), 198 deletions(-) diff --git a/charts/moco/templates/generated/crds/moco_crds.yaml b/charts/moco/templates/generated/crds/moco_crds.yaml index b622a7fa2..a33dad9d0 100644 --- a/charts/moco/templates/generated/crds/moco_crds.yaml +++ b/charts/moco/templates/generated/crds/moco_crds.yaml @@ -4,6 +4,7 @@ kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.15.0 + helm.sh/resource-policy: keep labels: app.kubernetes.io/managed-by: '{{ .Release.Service }}' app.kubernetes.io/name: '{{ include "moco.name" . }}' @@ -609,9 +610,6 @@ spec: type: string readOnly: type: boolean - recursiveReadOnly: - description: RecursiveReadOnlyMode describes recursive-readonly - type: string subPath: type: string subPathExpr: @@ -2151,12 +2149,8 @@ kind: CustomResourceDefinition metadata: annotations: cert-manager.io/inject-ca-from: '{{ .Release.Namespace }}/moco-serving-cert' -<<<<<<< HEAD - controller-gen.kubebuilder.io/version: v0.13.0 - helm.sh/resource-policy: keep -======= controller-gen.kubebuilder.io/version: v0.15.0 ->>>>>>> run contorller-gen and add new crd files + helm.sh/resource-policy: keep labels: app.kubernetes.io/managed-by: '{{ .Release.Service }}' app.kubernetes.io/name: '{{ include "moco.name" . }}' @@ -3138,14 +3132,6 @@ spec: properties: allowPrivilegeEscalation: type: boolean - appArmorProfile: - description: AppArmorProfileApplyConfiguration represents an de - properties: - localhostProfile: - type: string - type: - type: string - type: object capabilities: description: CapabilitiesApplyConfiguration represents an decla properties: @@ -3318,9 +3304,6 @@ spec: type: string readOnly: type: boolean - recursiveReadOnly: - description: RecursiveReadOnlyMode describes recursive-readonly - type: string subPath: type: string subPathExpr: @@ -3794,14 +3777,6 @@ spec: properties: allowPrivilegeEscalation: type: boolean - appArmorProfile: - description: AppArmorProfileApplyConfiguration represents an de - properties: - localhostProfile: - type: string - type: - type: string - type: object capabilities: description: CapabilitiesApplyConfiguration represents an decla properties: @@ -3976,9 +3951,6 @@ spec: type: string readOnly: type: boolean - recursiveReadOnly: - description: RecursiveReadOnlyMode describes recursive-readonly - type: string subPath: type: string subPathExpr: @@ -4455,14 +4427,6 @@ spec: properties: allowPrivilegeEscalation: type: boolean - appArmorProfile: - description: AppArmorProfileApplyConfiguration represents an de - properties: - localhostProfile: - type: string - type: - type: string - type: object capabilities: description: CapabilitiesApplyConfiguration represents an decla properties: @@ -4635,9 +4599,6 @@ spec: type: string readOnly: type: boolean - recursiveReadOnly: - description: RecursiveReadOnlyMode describes recursive-readonly - type: string subPath: type: string subPathExpr: @@ -4721,14 +4682,6 @@ spec: securityContext: description: PodSecurityContextApplyConfiguration represents an properties: - appArmorProfile: - description: AppArmorProfileApplyConfiguration represents an de - properties: - localhostProfile: - type: string - type: - type: string - type: object fsGroup: format: int64 type: integer @@ -5733,8 +5686,6 @@ spec: type: integer type: object type: object - trafficDistribution: - type: string type: description: 'Service Type string describes ingress methods for ' type: string @@ -5846,8 +5797,6 @@ spec: type: integer type: object type: object - trafficDistribution: - type: string type: description: 'Service Type string describes ingress methods for ' type: string @@ -6414,9 +6363,6 @@ spec: type: string readOnly: type: boolean - recursiveReadOnly: - description: RecursiveReadOnlyMode describes recursive-readonly - type: string subPath: type: string subPathExpr: diff --git a/config/crd/bases/moco.cybozu.com_backuppolicies.yaml b/config/crd/bases/moco.cybozu.com_backuppolicies.yaml index 9a658b433..f1aa2eec6 100644 --- a/config/crd/bases/moco.cybozu.com_backuppolicies.yaml +++ b/config/crd/bases/moco.cybozu.com_backuppolicies.yaml @@ -659,9 +659,6 @@ spec: type: string readOnly: type: boolean - recursiveReadOnly: - description: RecursiveReadOnlyMode describes recursive-readonly - type: string subPath: type: string subPathExpr: diff --git a/config/crd/bases/moco.cybozu.com_mysqlclusters.yaml b/config/crd/bases/moco.cybozu.com_mysqlclusters.yaml index 448dc533e..8c4f5558e 100644 --- a/config/crd/bases/moco.cybozu.com_mysqlclusters.yaml +++ b/config/crd/bases/moco.cybozu.com_mysqlclusters.yaml @@ -1067,15 +1067,6 @@ spec: properties: allowPrivilegeEscalation: type: boolean - appArmorProfile: - description: AppArmorProfileApplyConfiguration represents - an de - properties: - localhostProfile: - type: string - type: - type: string - type: object capabilities: description: CapabilitiesApplyConfiguration represents an decla @@ -1266,9 +1257,6 @@ spec: type: string readOnly: type: boolean - recursiveReadOnly: - description: RecursiveReadOnlyMode describes recursive-readonly - type: string subPath: type: string subPathExpr: @@ -1794,15 +1782,6 @@ spec: properties: allowPrivilegeEscalation: type: boolean - appArmorProfile: - description: AppArmorProfileApplyConfiguration represents - an de - properties: - localhostProfile: - type: string - type: - type: string - type: object capabilities: description: CapabilitiesApplyConfiguration represents an decla @@ -1995,9 +1974,6 @@ spec: type: string readOnly: type: boolean - recursiveReadOnly: - description: RecursiveReadOnlyMode describes recursive-readonly - type: string subPath: type: string subPathExpr: @@ -2523,15 +2499,6 @@ spec: properties: allowPrivilegeEscalation: type: boolean - appArmorProfile: - description: AppArmorProfileApplyConfiguration represents - an de - properties: - localhostProfile: - type: string - type: - type: string - type: object capabilities: description: CapabilitiesApplyConfiguration represents an decla @@ -2722,9 +2689,6 @@ spec: type: string readOnly: type: boolean - recursiveReadOnly: - description: RecursiveReadOnlyMode describes recursive-readonly - type: string subPath: type: string subPathExpr: @@ -2816,15 +2780,6 @@ spec: description: PodSecurityContextApplyConfiguration represents an properties: - appArmorProfile: - description: AppArmorProfileApplyConfiguration represents - an de - properties: - localhostProfile: - type: string - type: - type: string - type: object fsGroup: format: int64 type: integer @@ -3918,8 +3873,6 @@ spec: type: integer type: object type: object - trafficDistribution: - type: string type: description: 'Service Type string describes ingress methods for ' @@ -4038,8 +3991,6 @@ spec: type: integer type: object type: object - trafficDistribution: - type: string type: description: 'Service Type string describes ingress methods for ' @@ -4669,9 +4620,6 @@ spec: type: string readOnly: type: boolean - recursiveReadOnly: - description: RecursiveReadOnlyMode describes recursive-readonly - type: string subPath: type: string subPathExpr: diff --git a/config/crd/tests/apiextensions.k8s.io_v1_customresourcedefinition_backuppolicies.moco.cybozu.com.yaml b/config/crd/tests/apiextensions.k8s.io_v1_customresourcedefinition_backuppolicies.moco.cybozu.com.yaml index 749cd3d64..94730235f 100644 --- a/config/crd/tests/apiextensions.k8s.io_v1_customresourcedefinition_backuppolicies.moco.cybozu.com.yaml +++ b/config/crd/tests/apiextensions.k8s.io_v1_customresourcedefinition_backuppolicies.moco.cybozu.com.yaml @@ -658,9 +658,6 @@ spec: type: string readOnly: type: boolean - recursiveReadOnly: - description: RecursiveReadOnlyMode describes recursive-readonly - type: string subPath: type: string subPathExpr: diff --git a/config/crd/tests/apiextensions.k8s.io_v1_customresourcedefinition_mysqlclusters.moco.cybozu.com.yaml b/config/crd/tests/apiextensions.k8s.io_v1_customresourcedefinition_mysqlclusters.moco.cybozu.com.yaml index 8b65375c1..ae5e5d31f 100644 --- a/config/crd/tests/apiextensions.k8s.io_v1_customresourcedefinition_mysqlclusters.moco.cybozu.com.yaml +++ b/config/crd/tests/apiextensions.k8s.io_v1_customresourcedefinition_mysqlclusters.moco.cybozu.com.yaml @@ -1067,15 +1067,6 @@ spec: properties: allowPrivilegeEscalation: type: boolean - appArmorProfile: - description: AppArmorProfileApplyConfiguration represents - an de - properties: - localhostProfile: - type: string - type: - type: string - type: object capabilities: description: CapabilitiesApplyConfiguration represents an decla @@ -1266,9 +1257,6 @@ spec: type: string readOnly: type: boolean - recursiveReadOnly: - description: RecursiveReadOnlyMode describes recursive-readonly - type: string subPath: type: string subPathExpr: @@ -1794,15 +1782,6 @@ spec: properties: allowPrivilegeEscalation: type: boolean - appArmorProfile: - description: AppArmorProfileApplyConfiguration represents - an de - properties: - localhostProfile: - type: string - type: - type: string - type: object capabilities: description: CapabilitiesApplyConfiguration represents an decla @@ -1995,9 +1974,6 @@ spec: type: string readOnly: type: boolean - recursiveReadOnly: - description: RecursiveReadOnlyMode describes recursive-readonly - type: string subPath: type: string subPathExpr: @@ -2523,15 +2499,6 @@ spec: properties: allowPrivilegeEscalation: type: boolean - appArmorProfile: - description: AppArmorProfileApplyConfiguration represents - an de - properties: - localhostProfile: - type: string - type: - type: string - type: object capabilities: description: CapabilitiesApplyConfiguration represents an decla @@ -2722,9 +2689,6 @@ spec: type: string readOnly: type: boolean - recursiveReadOnly: - description: RecursiveReadOnlyMode describes recursive-readonly - type: string subPath: type: string subPathExpr: @@ -2816,15 +2780,6 @@ spec: description: PodSecurityContextApplyConfiguration represents an properties: - appArmorProfile: - description: AppArmorProfileApplyConfiguration represents - an de - properties: - localhostProfile: - type: string - type: - type: string - type: object fsGroup: format: int64 type: integer @@ -3918,8 +3873,6 @@ spec: type: integer type: object type: object - trafficDistribution: - type: string type: description: 'Service Type string describes ingress methods for ' @@ -4038,8 +3991,6 @@ spec: type: integer type: object type: object - trafficDistribution: - type: string type: description: 'Service Type string describes ingress methods for ' @@ -4669,9 +4620,6 @@ spec: type: string readOnly: type: boolean - recursiveReadOnly: - description: RecursiveReadOnlyMode describes recursive-readonly - type: string subPath: type: string subPathExpr: diff --git a/docs/usage.md b/docs/usage.md index 3dda2a4f4..74166cb78 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -36,6 +36,7 @@ After [setting up MOCO](setup.md), you can create MySQL clusters with a custom r - [Failover](#failover) - [Upgrading mysql version](#upgrading-mysql-version) - [Re-initializing an errant replica](#re-initializing-an-errant-replica) + - [Stop Clustering and Reconciliation](#stop-clustering-and-reconciliation) ## Basics @@ -428,13 +429,13 @@ spec: value: minioadmin - name: AWS_SECRET_ACCESS_KEY value: minioadmin - - # bucketName is required. Other fields are optional. + # bucketName is required. Other fields are optional. + # If backendType is s3 (default), specify the region of the bucket via region filed or AWS_REGION environment variable. bucketConfig: bucketName: moco + region: us-east-1 endpointURL: http://minio.default.svc:9000 usePathStyle: true - # MOCO uses a filesystem volume to store data temporarily. workVolume: # Using emptyDir as a working directory is NOT recommended. @@ -470,6 +471,7 @@ spec: jobConfig: bucketConfig: bucketName: "$(BUCKET_NAME)" + region: us-east-1 endpointURL: http://minio.default.svc:9000 usePathStyle: true envFrom: @@ -573,6 +575,7 @@ spec: value: minioadmin bucketConfig: bucketName: moco + region: us-east-1 endpointURL: http://minio.default.svc:9000 usePathStyle: true workVolume: diff --git a/e2e/testdata/backup.yaml b/e2e/testdata/backup.yaml index 8c87e5df8..831926e96 100644 --- a/e2e/testdata/backup.yaml +++ b/e2e/testdata/backup.yaml @@ -31,6 +31,8 @@ spec: value: minioadmin - name: AWS_SECRET_ACCESS_KEY value: minioadmin + - name: AWS_REGION + value: us-east-1 bucketConfig: bucketName: moco endpointURL: http://minio.default.svc:9000 diff --git a/e2e/testdata/backup_tls.yaml b/e2e/testdata/backup_tls.yaml index b30631173..16c09b002 100644 --- a/e2e/testdata/backup_tls.yaml +++ b/e2e/testdata/backup_tls.yaml @@ -31,6 +31,8 @@ spec: value: minioadmin - name: AWS_SECRET_ACCESS_KEY value: minioadmin + - name: AWS_REGION + value: us-east-1 volumeMounts: - mountPath: /minio-cert name: minio-cert diff --git a/e2e/testdata/backup_with_env.yaml b/e2e/testdata/backup_with_env.yaml index 8c52bbe2b..dd6bc8ab0 100644 --- a/e2e/testdata/backup_with_env.yaml +++ b/e2e/testdata/backup_with_env.yaml @@ -31,6 +31,8 @@ spec: value: minioadmin - name: AWS_SECRET_ACCESS_KEY value: minioadmin + - name: AWS_REGION + value: us-east-1 bucketConfig: bucketName: "$(BUCKET_NAME)" endpointURL: http://minio.default.svc:9000 diff --git a/e2e/testdata/restore.yaml b/e2e/testdata/restore.yaml index 7042a851a..79835305b 100644 --- a/e2e/testdata/restore.yaml +++ b/e2e/testdata/restore.yaml @@ -17,6 +17,8 @@ spec: value: minioadmin - name: AWS_SECRET_ACCESS_KEY value: minioadmin + - name: AWS_REGION + value: us-east-1 bucketConfig: bucketName: moco endpointURL: http://minio.default.svc:9000 diff --git a/e2e/testdata/restore_tls.yaml b/e2e/testdata/restore_tls.yaml index f15fb21d1..ed45f4440 100644 --- a/e2e/testdata/restore_tls.yaml +++ b/e2e/testdata/restore_tls.yaml @@ -17,6 +17,8 @@ spec: value: minioadmin - name: AWS_SECRET_ACCESS_KEY value: minioadmin + - name: AWS_REGION + value: us-east-1 volumeMounts: - mountPath: /minio-cert name: minio-cert diff --git a/e2e/testdata/restore_with_env.yaml b/e2e/testdata/restore_with_env.yaml index 13d593e1a..535c56490 100644 --- a/e2e/testdata/restore_with_env.yaml +++ b/e2e/testdata/restore_with_env.yaml @@ -17,6 +17,8 @@ spec: value: minioadmin - name: AWS_SECRET_ACCESS_KEY value: minioadmin + - name: AWS_REGION + value: us-east-1 bucketConfig: bucketName: "$(BUCKET_NAME)" endpointURL: http://minio.default.svc:9000 diff --git a/go.mod b/go.mod index a8fe3fc14..57e3cc16f 100644 --- a/go.mod +++ b/go.mod @@ -27,14 +27,14 @@ require ( google.golang.org/api v0.181.0 google.golang.org/grpc v1.64.0 google.golang.org/protobuf v1.34.1 - k8s.io/api v0.30.1 - k8s.io/apimachinery v0.30.1 - k8s.io/cli-runtime v0.30.1 - k8s.io/client-go v0.30.1 + k8s.io/api v0.29.5 + k8s.io/apimachinery v0.29.5 + k8s.io/cli-runtime v0.29.5 + k8s.io/client-go v0.29.5 k8s.io/klog/v2 v2.120.1 - k8s.io/kubectl v0.30.1 + k8s.io/kubectl v0.29.5 k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0 - sigs.k8s.io/controller-runtime v0.18.2 + sigs.k8s.io/controller-runtime v0.17.5 ) require ( @@ -136,12 +136,12 @@ require ( gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/apiextensions-apiserver v0.30.0 // indirect - k8s.io/component-base v0.30.1 // indirect + k8s.io/apiextensions-apiserver v0.29.5 // indirect + k8s.io/component-base v0.29.5 // indirect k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/kustomize/api v0.13.5-0.20230601165947-6ce0bf390ce3 // indirect sigs.k8s.io/kustomize/kyaml v0.14.3-0.20230601165947-6ce0bf390ce3 // indirect sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect - sigs.k8s.io/yaml v1.3.0 // indirect + sigs.k8s.io/yaml v1.4.0 // indirect ) diff --git a/go.sum b/go.sum index 4b0dfd885..e8f48cb0f 100644 --- a/go.sum +++ b/go.sum @@ -434,28 +434,28 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -k8s.io/api v0.30.1 h1:kCm/6mADMdbAxmIh0LBjS54nQBE+U4KmbCfIkF5CpJY= -k8s.io/api v0.30.1/go.mod h1:ddbN2C0+0DIiPntan/bye3SW3PdwLa11/0yqwvuRrJM= -k8s.io/apiextensions-apiserver v0.30.0 h1:jcZFKMqnICJfRxTgnC4E+Hpcq8UEhT8B2lhBcQ+6uAs= -k8s.io/apiextensions-apiserver v0.30.0/go.mod h1:N9ogQFGcrbWqAY9p2mUAL5mGxsLqwgtUce127VtRX5Y= -k8s.io/apimachinery v0.30.1 h1:ZQStsEfo4n65yAdlGTfP/uSHMQSoYzU/oeEbkmF7P2U= -k8s.io/apimachinery v0.30.1/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc= -k8s.io/cli-runtime v0.30.1 h1:kSBBpfrJGS6lllc24KeniI9JN7ckOOJKnmFYH1RpTOw= -k8s.io/cli-runtime v0.30.1/go.mod h1:zhHgbqI4J00pxb6gM3gJPVf2ysDjhQmQtnTxnMScab8= -k8s.io/client-go v0.30.1 h1:uC/Ir6A3R46wdkgCV3vbLyNOYyCJ8oZnjtJGKfytl/Q= -k8s.io/client-go v0.30.1/go.mod h1:wrAqLNs2trwiCH/wxxmT/x3hKVH9PuV0GGW0oDoHVqc= -k8s.io/component-base v0.30.1 h1:bvAtlPh1UrdaZL20D9+sWxsJljMi0QZ3Lmw+kmZAaxQ= -k8s.io/component-base v0.30.1/go.mod h1:e/X9kDiOebwlI41AvBHuWdqFriSRrX50CdwA9TFaHLI= +k8s.io/api v0.29.5 h1:levS+umUigHCfI3riD36pMY1vQEbrzh4r1ivVWAhHaI= +k8s.io/api v0.29.5/go.mod h1:7b18TtPcJzdjk7w5zWyIHgoAtpGeRvGGASxlS7UZXdQ= +k8s.io/apiextensions-apiserver v0.29.5 h1:njDywexhE6n+1NEl3A4axT0TMQHREnndrk3/ztdWcNE= +k8s.io/apiextensions-apiserver v0.29.5/go.mod h1:pfIvij+MH9a8NQKtW7MD4EFnzvUjJ1ZQsDL8wuP8fnc= +k8s.io/apimachinery v0.29.5 h1:Hofa2BmPfpoT+IyDTlcPdCHSnHtEQMoJYGVoQpRTfv4= +k8s.io/apimachinery v0.29.5/go.mod h1:i3FJVwhvSp/6n8Fl4K97PJEP8C+MM+aoDq4+ZJBf70Y= +k8s.io/cli-runtime v0.29.5 h1:gnDrFEA4Xr8lAdc5U4tVfU7RGAmM/yvVvW9f0ao7g2s= +k8s.io/cli-runtime v0.29.5/go.mod h1:6KuWJyLIpbh2II874fA1SnmGHvZCitsHRR1XDowsMC0= +k8s.io/client-go v0.29.5 h1:nlASXmPQy190qTteaVP31g3c/wi2kycznkTP7Sv1zPc= +k8s.io/client-go v0.29.5/go.mod h1:aY5CnqUUvXYccJhm47XHoPcRyX6vouHdIBHaKZGTbK4= +k8s.io/component-base v0.29.5 h1:Ptj8AzG+p8c2a839XriHwxakDpZH9uvIgYz+o1agjg8= +k8s.io/component-base v0.29.5/go.mod h1:9nBUoPxW/yimISIgAG7sJDrUGJlu7t8HnDafIrOdU8Q= k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98= -k8s.io/kubectl v0.30.1 h1:sHFIRI3oP0FFZmBAVEE8ErjnTyXDPkBcvO88mH9RjuY= -k8s.io/kubectl v0.30.1/go.mod h1:7j+L0Cc38RYEcx+WH3y44jRBe1Q1jxdGPKkX0h4iDq0= +k8s.io/kubectl v0.29.5 h1:Y41B5AhRKMfDVKgFkS5vHKX43aHVch6+QIszCborERc= +k8s.io/kubectl v0.29.5/go.mod h1:/bxZpurdrKZFz/sa7jlLy1S8IxSiWhJCoA+DhLp7/T4= k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0 h1:jgGTlFYnhF1PM1Ax/lAlxUPE+KfCIXHaathvJg1C3ak= k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -sigs.k8s.io/controller-runtime v0.18.2 h1:RqVW6Kpeaji67CY5nPEfRz6ZfFMk0lWQlNrLqlNpx+Q= -sigs.k8s.io/controller-runtime v0.18.2/go.mod h1:tuAt1+wbVsXIT8lPtk5RURxqAnq7xkpv2Mhttslg7Hw= +sigs.k8s.io/controller-runtime v0.17.5 h1:1FI9Lm7NiOOmBsgTV36/s2XrEFXnO2C4sbg/Zme72Rw= +sigs.k8s.io/controller-runtime v0.17.5/go.mod h1:N0jpP5Lo7lMTF9aL56Z/B2oWBJjey6StQM0jRbKQXtY= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/kustomize/api v0.13.5-0.20230601165947-6ce0bf390ce3 h1:XX3Ajgzov2RKUdc5jW3t5jwY7Bo7dcRm+tFxT+NfgY0= @@ -464,5 +464,5 @@ sigs.k8s.io/kustomize/kyaml v0.14.3-0.20230601165947-6ce0bf390ce3 h1:W6cLQc5pnqM sigs.k8s.io/kustomize/kyaml v0.14.3-0.20230601165947-6ce0bf390ce3/go.mod h1:JWP1Fj0VWGHyw3YUPjXSQnRnrwezrZSrApfX5S0nIag= sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= -sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= -sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/pkg/bucket/s3.go b/pkg/bucket/s3.go index 67624c00f..bfe38869b 100644 --- a/pkg/bucket/s3.go +++ b/pkg/bucket/s3.go @@ -62,7 +62,7 @@ type s3Bucket struct { // NewS3Bucket creates a Bucket that manage object in S3. func NewS3Bucket(name string, optFns ...func(*s3.Options)) (Bucket, error) { - cfg, err := config.LoadDefaultConfig(context.Background(), config.WithRegion("us-west-2")) + cfg, err := config.LoadDefaultConfig(context.Background()) if err != nil { return nil, err } diff --git a/pkg/bucket/s3_test.go b/pkg/bucket/s3_test.go index fbaa14e87..f4fa1e45f 100644 --- a/pkg/bucket/s3_test.go +++ b/pkg/bucket/s3_test.go @@ -45,10 +45,11 @@ var _ = Describe("S3Bucket", func() { AccessKeyID: "minioadmin", SecretAccessKey: "minioadmin", Source: "minio default credentials", - }}), config.WithRegion("us-west-2")) + }})) Expect(err).NotTo(HaveOccurred()) client := s3.NewFromConfig(cfg, WithEndpointURL("http://localhost:9000"), + WithRegion("us-east-1"), WithPathStyle(), ) @@ -68,6 +69,7 @@ var _ = Describe("S3Bucket", func() { It("should put and get objects", func() { os.Setenv("AWS_ACCESS_KEY_ID", "minioadmin") os.Setenv("AWS_SECRET_ACCESS_KEY", "minioadmin") + os.Setenv("AWS_REGION", "us-east-1") b, err := NewS3Bucket("test", WithEndpointURL("http://localhost:9000"), WithPathStyle()) Expect(err).NotTo(HaveOccurred()) @@ -101,6 +103,7 @@ var _ = Describe("S3Bucket", func() { It("should put unseekable objects", func() { os.Setenv("AWS_ACCESS_KEY_ID", "minioadmin") os.Setenv("AWS_SECRET_ACCESS_KEY", "minioadmin") + os.Setenv("AWS_REGION", "us-east-1") b, err := NewS3Bucket("test", WithEndpointURL("http://localhost:9000"), WithPathStyle()) Expect(err).NotTo(HaveOccurred()) @@ -140,6 +143,7 @@ var _ = Describe("S3Bucket", func() { It("should put objects and get list of objects up to delimiter", func() { os.Setenv("AWS_ACCESS_KEY_ID", "minioadmin") os.Setenv("AWS_SECRET_ACCESS_KEY", "minioadmin") + os.Setenv("AWS_REGION", "us-east-1") b, err := NewS3Bucket("test", WithEndpointURL("http://localhost:9000"), WithPathStyle()) Expect(err).NotTo(HaveOccurred())