diff --git a/.github/workflows/controllers.yml b/.github/workflows/controllers.yml index 35aea28200d..78f224ae985 100644 --- a/.github/workflows/controllers.yml +++ b/.github/workflows/controllers.yml @@ -99,6 +99,7 @@ jobs: - { name: resources, path: resources } - { name: node, path: node } - { name: admission, path: admission } + - { name: objectstorage, path: objectstorage } steps: - name: Checkout uses: actions/checkout@v3 @@ -200,6 +201,7 @@ jobs: - { name: resources, path: resources } - { name: node, path: node } - { name: admission, path: admission } + - { name: objectstorage, path: objectstorage } steps: - name: Checkout uses: actions/checkout@v3 diff --git a/controllers/objectstorage/config/default/manager_auth_proxy_patch.yaml b/controllers/objectstorage/config/default/manager_auth_proxy_patch.yaml index e9ac3b531db..3e964e68f81 100644 --- a/controllers/objectstorage/config/default/manager_auth_proxy_patch.yaml +++ b/controllers/objectstorage/config/default/manager_auth_proxy_patch.yaml @@ -67,11 +67,11 @@ spec: - name: OSNamespace value: "objectstorage-system" - name: OSAdminSecret - value: "object-storage-sealos-user-0" + value: '{{ .OSAdminSecret }}' - name: OSInternalEndpoint - value: "object-storage.objectstorage-system.svc.cluster.local" + value: '{{ .OSInternalEndpoint }}' - name: OSExternalEndpoint - value: "objectstorage.dev.sealos.top" + value: '{{ .OSExternalEndpoint }}' - name: OSUDetectionCycleSeconds value: "300" - name: MinioBucketDetectionCycleSeconds diff --git a/controllers/objectstorage/controllers/objectstorageuser_controller.go b/controllers/objectstorage/controllers/objectstorageuser_controller.go index 1d2eaf642fa..899009d4c02 100644 --- a/controllers/objectstorage/controllers/objectstorageuser_controller.go +++ b/controllers/objectstorage/controllers/objectstorageuser_controller.go @@ -289,7 +289,7 @@ func (r *ObjectStorageUserReconciler) initObjectStorageUser(user *objectstoragev updated = true } - if user.Status.AccessKey == "" { + if user.Status.AccessKey != username { user.Status.AccessKey = username updated = true } @@ -299,12 +299,12 @@ func (r *ObjectStorageUserReconciler) initObjectStorageUser(user *objectstoragev updated = true } - if user.Status.Internal == "" { + if user.Status.Internal == r.InternalEndpoint { user.Status.Internal = r.InternalEndpoint updated = true } - if user.Status.External == "" { + if user.Status.External == r.ExternalEndpoint { user.Status.External = r.ExternalEndpoint updated = true } diff --git a/controllers/objectstorage/deploy/Kubefile b/controllers/objectstorage/deploy/Kubefile new file mode 100644 index 00000000000..284718960fa --- /dev/null +++ b/controllers/objectstorage/deploy/Kubefile @@ -0,0 +1,13 @@ +FROM scratch + +USER 65532:65532 + +COPY registry registry +COPY manifests manifests + +ENV DEFAULT_NAMESPACE objectstorage-system +ENV OSAdminSecret="" +ENV OSInternalEndpoint="" +ENV OSExternalEndpoint="" + +CMD ["kubectl apply -f manifests/deploy.yaml -n $DEFAULT_NAMESPACE"] diff --git a/controllers/objectstorage/deploy/manifests/deploy.yaml b/controllers/objectstorage/deploy/manifests/deploy.yaml index 610a59efd26..a27d02d9755 100644 --- a/controllers/objectstorage/deploy/manifests/deploy.yaml +++ b/controllers/objectstorage/deploy/manifests/deploy.yaml @@ -491,11 +491,11 @@ spec: - name: OSNamespace value: objectstorage-system - name: OSAdminSecret - value: object-storage-sealos-user-0 + value: '{{ .OSAdminSecret }}' - name: OSInternalEndpoint - value: object-storage.objectstorage-system.svc.cluster.local + value: '{{ .OSInternalEndpoint }}' - name: OSExternalEndpoint - value: objectstorage.dev.sealos.top + value: '{{ .OSExternalEndpoint }}' - name: OSUDetectionCycleSeconds value: "300" - name: MinioBucketDetectionCycleSeconds