Skip to content

Commit

Permalink
fix sync error (#4342)
Browse files Browse the repository at this point in the history
* fix sync error

* review

* add licnese

* add Kubefile

* Update controllers.yml

add cluster image for objectstorage

---------

Co-authored-by: Jiahui <bxy4543@163.com>
  • Loading branch information
nowinkeyy and bxy4543 committed Nov 27, 2023
1 parent 9bb66eb commit 77fdddc
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/controllers.yml
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Expand Up @@ -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
Expand Down
Expand Up @@ -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
}
Expand All @@ -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
}
Expand Down
13 changes: 13 additions & 0 deletions 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"]
6 changes: 3 additions & 3 deletions controllers/objectstorage/deploy/manifests/deploy.yaml
Expand Up @@ -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
Expand Down

0 comments on commit 77fdddc

Please sign in to comment.