You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@seata.apache.org by ji...@apache.org on 2025/03/05 02:05:33 UTC

(incubator-seata-k8s) branch master updated: bugfix: correct persistence storage configuration in seata-server-cluster.yaml (#24)

This is an automated email from the ASF dual-hosted git repository.

jimin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-seata-k8s.git


The following commit(s) were added to refs/heads/master by this push:
     new 3f8ed0f  bugfix: correct persistence storage configuration in seata-server-cluster.yaml (#24)
3f8ed0f is described below

commit 3f8ed0fd88560abb4f4feeaa438df0191eb8e343
Author: flypiggy <15...@users.noreply.github.com>
AuthorDate: Wed Mar 5 10:05:29 2025 +0800

    bugfix: correct persistence storage configuration in seata-server-cluster.yaml (#24)
---
 .github/workflows/build.yml                        |  7 ++-
 .github/workflows/publish-docker.yml               |  7 ++-
 Dockerfile                                         |  5 +-
 api/v1alpha1/seataserver_types.go                  | 27 +++++++++++
 api/v1alpha1/zz_generated.deepcopy.go              | 53 ++++++++++++++++++++++
 .../operator.seata.apache.org_seataservers.yaml    | 16 +++++++
 6 files changed, 111 insertions(+), 4 deletions(-)

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index c296d26..93b17eb 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -14,6 +14,11 @@ jobs:
       - name: Checkout
         uses: actions/checkout@v3
 
+      - name: Set up Go
+        uses: actions/setup-go@v4
+        with:
+          go-version: '1.21'
+
       - name: Set up QEMU
         uses: docker/setup-qemu-action@v3
 
@@ -21,4 +26,4 @@ jobs:
         uses: docker/setup-buildx-action@v3
 
       - name: Docker Build And Go Test
-        run: make docker-build
+        run: make docker-build
\ No newline at end of file
diff --git a/.github/workflows/publish-docker.yml b/.github/workflows/publish-docker.yml
index 371b1e1..6cf3dee 100644
--- a/.github/workflows/publish-docker.yml
+++ b/.github/workflows/publish-docker.yml
@@ -11,6 +11,11 @@ jobs:
       - name: Checkout
         uses: actions/checkout@v3
 
+      - name: Set up Go
+        uses: actions/setup-go@v4
+        with:
+          go-version: '1.21'
+
       - name: Set up QEMU
         uses: docker/setup-qemu-action@v3
 
@@ -29,4 +34,4 @@ jobs:
             make docker-build docker-push
           else
             IMG=apache/seata-controller:${{ github.ref_name }} make docker-build docker-push
-          fi
+          fi
\ No newline at end of file
diff --git a/Dockerfile b/Dockerfile
index fccc002..2f8bcb2 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,5 +1,5 @@
 # Build the manager binary
-FROM golang:1.21 as builder
+FROM golang:1.21 AS builder
 ARG TARGETOS
 ARG TARGETARCH
 
@@ -9,7 +9,8 @@ COPY go.mod go.mod
 COPY go.sum go.sum
 # cache deps before building and copying source so that we don't need to re-download as much
 # and so that source changes don't invalidate our downloaded layer
-ENV GOPROXY=https://goproxy.cn
+ENV GOPROXY="https://proxy.golang.org,direct"
+ENV GO111MODULE=on
 RUN go mod download
 
 # Copy the go source
diff --git a/api/v1alpha1/seataserver_types.go b/api/v1alpha1/seataserver_types.go
index 265c5c2..6fc2ccf 100644
--- a/api/v1alpha1/seataserver_types.go
+++ b/api/v1alpha1/seataserver_types.go
@@ -46,6 +46,9 @@ type SeataServerSpec struct {
 
 	// +kubebuilder:validation:Optional
 	Persistence Persistence `json:"persistence,omitempty"`
+
+	// +kubebuilder:validation:Optional
+	Store Store `json:"store,omitempty"`
 }
 
 func (s *SeataServerSpec) withDefaults() (changed bool) {
@@ -63,6 +66,13 @@ func (s *SeataServerSpec) withDefaults() (changed bool) {
 	}
 	changed = s.Ports.withDefaults() || changed
 	changed = s.Persistence.withDefaults() || changed
+
+	if s.Store.Resources.Requests.Storage == nil {
+		defaultStorage := resource.MustParse("5Gi")
+		s.Store.Resources.Requests.Storage = &defaultStorage
+		changed = true
+	}
+
 	return changed
 }
 
@@ -133,6 +143,23 @@ func (p *Ports) withDefaults() bool {
 	return false
 }
 
+// Store defines the storage configuration for SeataServer
+// +kubebuilder:object:generate=true
+type Store struct {
+	// +kubebuilder:validation:Optional
+	Resources StorageResources `json:"resources,omitempty"`
+}
+
+type StorageResources struct {
+	// +kubebuilder:validation:Optional
+	Requests ResourceList `json:"requests,omitempty"`
+}
+
+type ResourceList struct {
+	// +kubebuilder:validation:Optional
+	Storage *resource.Quantity `json:"storage,omitempty"`
+}
+
 type Persistence struct {
 	// VolumeReclaimPolicy is a seata operator configuration. If it's set to Delete,
 	// the corresponding PVCs will be deleted by the operator when seata server cluster is deleted.
diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go
index 3c328ca..ba75da3 100644
--- a/api/v1alpha1/zz_generated.deepcopy.go
+++ b/api/v1alpha1/zz_generated.deepcopy.go
@@ -301,6 +301,26 @@ func (in *RBAC) DeepCopy() *RBAC {
 	return out
 }
 
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ResourceList) DeepCopyInto(out *ResourceList) {
+	*out = *in
+	if in.Storage != nil {
+		in, out := &in.Storage, &out.Storage
+		x := (*in).DeepCopy()
+		*out = &x
+	}
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceList.
+func (in *ResourceList) DeepCopy() *ResourceList {
+	if in == nil {
+		return nil
+	}
+	out := new(ResourceList)
+	in.DeepCopyInto(out)
+	return out
+}
+
 // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
 func (in *SeataServer) DeepCopyInto(out *SeataServer) {
 	*out = *in
@@ -366,6 +386,7 @@ func (in *SeataServerSpec) DeepCopyInto(out *SeataServerSpec) {
 	in.ContainerSpec.DeepCopyInto(&out.ContainerSpec)
 	out.Ports = in.Ports
 	in.Persistence.DeepCopyInto(&out.Persistence)
+	in.Store.DeepCopyInto(&out.Store)
 }
 
 // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SeataServerSpec.
@@ -448,3 +469,35 @@ func (in *ServiceAccount) DeepCopy() *ServiceAccount {
 	in.DeepCopyInto(out)
 	return out
 }
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *StorageResources) DeepCopyInto(out *StorageResources) {
+	*out = *in
+	in.Requests.DeepCopyInto(&out.Requests)
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageResources.
+func (in *StorageResources) DeepCopy() *StorageResources {
+	if in == nil {
+		return nil
+	}
+	out := new(StorageResources)
+	in.DeepCopyInto(out)
+	return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *Store) DeepCopyInto(out *Store) {
+	*out = *in
+	in.Resources.DeepCopyInto(&out.Resources)
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Store.
+func (in *Store) DeepCopy() *Store {
+	if in == nil {
+		return nil
+	}
+	out := new(Store)
+	in.DeepCopyInto(out)
+	return out
+}
diff --git a/config/crd/bases/operator.seata.apache.org_seataservers.yaml b/config/crd/bases/operator.seata.apache.org_seataservers.yaml
index 88fc5b2..92e51dc 100644
--- a/config/crd/bases/operator.seata.apache.org_seataservers.yaml
+++ b/config/crd/bases/operator.seata.apache.org_seataservers.yaml
@@ -441,6 +441,22 @@ spec:
               serviceName:
                 default: seata-server-cluster
                 type: string
+              store:
+                description: Store defines the storage configuration for SeataServer
+                properties:
+                  resources:
+                    properties:
+                      requests:
+                        properties:
+                          storage:
+                            anyOf:
+                            - type: integer
+                            - type: string
+                            pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
+                            x-kubernetes-int-or-string: true
+                        type: object
+                    type: object
+                type: object
             type: object
           status:
             description: SeataServerStatus defines the observed state of SeataServer


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org