Skip to content

Commit

Permalink
fix: fix storage nil err and update operator-go's resourceSpec (#100)
Browse files Browse the repository at this point in the history
* fix: add missing 'ProductName' parameter to the 'TansformImage' function

close #98

* feat(resournces): repalce resourceSpec with operator's

* fix(resource): fix nil error when storage size is not specified

close #97
  • Loading branch information
lwpk110 authored Sep 6, 2024
1 parent 6373edc commit 6005a9a
Show file tree
Hide file tree
Showing 22 changed files with 97 additions and 217 deletions.
6 changes: 3 additions & 3 deletions .chainsaw.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ kind: Configuration
metadata:
name: custom-config
spec:
# namespace: test
#namespace: test
timeouts:
apply: 420s
assert: 600s
apply: 120s
assert: 120s
cleanup: 240s
delete: 240s
error: 200s
Expand Down
7 changes: 5 additions & 2 deletions api/v1alpha1/datanode.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package v1alpha1

import corev1 "k8s.io/api/core/v1"
import (
commonsv1alpha1 "github.com/zncdatadev/operator-go/pkg/apis/commons/v1alpha1"
corev1 "k8s.io/api/core/v1"
)

type DataNodeRoleGroupSpec struct {
// +kubebuilder:validation:Optional
Expand All @@ -22,7 +25,7 @@ type DataNodeRoleGroupSpec struct {

type DataNodeConfigSpec struct {
// +kubebuilder:validation:Optional
Resources *ResourcesSpec `json:"resources,omitempty"`
Resources *commonsv1alpha1.ResourcesSpec `json:"resources,omitempty"`

// +kubebuilder:validation:Optional
// +kubebuilder:default="external-unstable"
Expand Down
1 change: 1 addition & 0 deletions api/v1alpha1/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@ func TransformImage(imageSpec *ImageSpec) *util.Image {
ProductVersion: imageSpec.ProductVersion,
PullPolicy: imageSpec.PullPolicy,
PullSecretName: imageSpec.PullSecretName,
ProductName: DefaultProductName,
}
}
7 changes: 5 additions & 2 deletions api/v1alpha1/journalnode.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package v1alpha1

import corev1 "k8s.io/api/core/v1"
import (
commonsv1alpha1 "github.com/zncdatadev/operator-go/pkg/apis/commons/v1alpha1"
corev1 "k8s.io/api/core/v1"
)

type JournalNodeRoleGroupSpec struct {
// +kubebuilder:validation:Optional
Expand All @@ -22,7 +25,7 @@ type JournalNodeRoleGroupSpec struct {

type JournalNodeConfigSpec struct {
// +kubebuilder:validation:Optional
Resources *ResourcesSpec `json:"resources,omitempty"`
Resources *commonsv1alpha1.ResourcesSpec `json:"resources,omitempty"`

// +kubebuilder:validation:Optional
// +kubebuilder:default="cluster-internal"
Expand Down
7 changes: 5 additions & 2 deletions api/v1alpha1/namenode.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package v1alpha1

import corev1 "k8s.io/api/core/v1"
import (
commonsv1alpha1 "github.com/zncdatadev/operator-go/pkg/apis/commons/v1alpha1"
corev1 "k8s.io/api/core/v1"
)

type NameNodeRoleGroupSpec struct {
// +kubebuilder:validation:Optional
Expand All @@ -22,7 +25,7 @@ type NameNodeRoleGroupSpec struct {

type NameNodeConfigSpec struct {
// +kubebuilder:validation:Optional
Resources *ResourcesSpec `json:"resources,omitempty"`
Resources *commonsv1alpha1.ResourcesSpec `json:"resources,omitempty"`

// +kubebuilder:validation:Optional
// +kubebuilder:default="external-stable"
Expand Down
47 changes: 0 additions & 47 deletions api/v1alpha1/resources.go

This file was deleted.

122 changes: 4 additions & 118 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions config/crd/bases/hdfs.zncdata.dev_hdfsclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1259,6 +1259,7 @@ spec:
anyOf:
- type: integer
- type: string
default: 10Gi
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
storageClass:
Expand Down Expand Up @@ -2737,6 +2738,7 @@ spec:
anyOf:
- type: integer
- type: string
default: 10Gi
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
storageClass:
Expand Down Expand Up @@ -4139,6 +4141,7 @@ spec:
anyOf:
- type: integer
- type: string
default: 10Gi
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
storageClass:
Expand Down Expand Up @@ -5534,6 +5537,7 @@ spec:
anyOf:
- type: integer
- type: string
default: 10Gi
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
storageClass:
Expand Down Expand Up @@ -7165,6 +7169,7 @@ spec:
anyOf:
- type: integer
- type: string
default: 10Gi
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
storageClass:
Expand Down Expand Up @@ -8809,6 +8814,7 @@ spec:
anyOf:
- type: integer
- type: string
default: 10Gi
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
storageClass:
Expand Down
Loading

0 comments on commit 6005a9a

Please sign in to comment.