Skip to content

Commit

Permalink
feat: bump operator-go 0.8.3 and refactor reconciler (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
whg517 authored Jul 26, 2024
1 parent 4c84f52 commit 7a11817
Show file tree
Hide file tree
Showing 54 changed files with 36,173 additions and 6,865 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ endif

# Set the Operator SDK version to use. By default, what is installed on the system is used.
# This is useful for CI or a project to utilize a specific version of the operator-sdk toolkit.
OPERATOR_SDK_VERSION ?= v1.34.2
OPERATOR_SDK_VERSION ?= v1.35.0

# Image URL to use all building/pushing image targets
IMG ?= $(IMAGE_TAG_BASE):v$(VERSION)
Expand Down
25 changes: 23 additions & 2 deletions api/v1alpha1/image_types.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,33 @@
package v1alpha1

import (
corev1 "k8s.io/api/core/v1"
)

const (
DefaultRepository = "quay.io/zncdatadev"
DefaultProductVersion = "4.0.1"
)

type ImageSpec struct {
// +kubebuilder:validation:Optional
Custom string `json:"custom,omitempty"`

// +kubebuilder:validation:Optional
Repo string `json:"repo,omitempty"`
// +kubebuilder:default=quay.io/zncdatadev
Repository string `json:"repository,omitempty"`

// +kubebuilder:validation:Optional
KDSVersion string `json:"kdsVersion,omitempty"`
StackVersion string `json:"stackVersion,omitempty"`

// +kubebuilder:validation:Optional
// +kubebuilder:default="4.0.1"
ProductVersion string `json:"productVersion,omitempty"`

// +kubebuilder:validation:Optional
// +kubebuilder:default:=IfNotPresent
PullPolicy corev1.PullPolicy `json:"pullPolicy,omitempty"`

// +kubebuilder:validation:Optional
PullSecretName string `json:"pullSecretName,omitempty"`
}
6 changes: 4 additions & 2 deletions api/v1alpha1/node_types.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package v1alpha1

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

type NodeSpec struct {
RoleGroups map[string]NodeRoleGroupSpec `json:"roleGroups,omitempty"`
Config *NodeConfigSpec `json:"config,omitempty"`
PodDisruptionBudget *apiv1alpha1.PodDisruptionBudgetSpec `json:"podDisruptionBudget,omitempty"`
PodOverride *corev1.PodTemplateSpec `json:"podOverride,omitempty"`
CommandOverrides []string `json:"commandOverrides,omitempty"`
EnvOverrides []string `json:"envOverrides,omitempty"`
ConfigOverrides *NodeConfigOverridesSpec `json:"configOverrides,omitempty"`
Expand All @@ -18,14 +19,15 @@ type NodeConfigSpec struct {
Affinity *corev1.Affinity `json:"affinity,omitempty"`
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
PodDisruptionBudget *apiv1alpha1.PodDisruptionBudgetSpec `json:"podDisruptionBudget,omitempty"`
GracefulShutdownTimeout *string `json:"gracefulShutdownTimeoutSeconds,omitempty"`
GracefulShutdownTimeout string `json:"gracefulShutdownTimeoutSeconds,omitempty"`
Logging *apiv1alpha1.LoggingConfigSpec `json:"logging,omitempty"`
Resources *apiv1alpha1.ResourcesSpec `json:"resources,omitempty"`
}

type NodeRoleGroupSpec struct {
Replicas *int32 `json:"replicas,omitempty"`
Config *NodeConfigSpec `json:"config,omitempty"`
PodOverride *corev1.PodTemplateSpec `json:"podOverride,omitempty"`
PodDisruptionBudget *apiv1alpha1.PodDisruptionBudgetSpec `json:"podDisruptionBudget,omitempty"`
CommandOverrides []string `json:"commandOverrides,omitempty"`
EnvOverrides map[string]string `json:"envOverrides,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha1/supersetcluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
package v1alpha1

import (
apiv1alpha1 "github.com/zncdatadev/superset-operator/pkg/apis/v1alpha1"
apiv1alpha1 "github.com/zncdatadev/operator-go/pkg/apis/commons/v1alpha1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

Expand Down
6 changes: 4 additions & 2 deletions api/v1alpha1/worker_types.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package v1alpha1

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

type WorkerSpec struct {
RoleGroups map[string]WorkerRoleGroupSpec `json:"roleGroups,omitempty"`
Config *WorkerConfigSpec `json:"config,omitempty"`
PodOverride *corev1.PodTemplateSpec `json:"podOverride,omitempty"`
PodDisruptionBudget *apiv1alpha1.PodDisruptionBudgetSpec `json:"podDisruptionBudget,omitempty"`
CommandOverrides []string `json:"commandOverrides,omitempty"`
EnvOverrides []string `json:"envOverrides,omitempty"`
Expand All @@ -18,14 +19,15 @@ type WorkerConfigSpec struct {
Affinity *corev1.Affinity `json:"affinity,omitempty"`
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
PodDisruptionBudget *apiv1alpha1.PodDisruptionBudgetSpec `json:"podDisruptionBudget,omitempty"`
GracefulShutdownTimeout *string `json:"gracefulShutdownTimeoutSeconds,omitempty"`
GracefulShutdownTimeout string `json:"gracefulShutdownTimeoutSeconds,omitempty"`
Logging *apiv1alpha1.LoggingConfigSpec `json:"logging,omitempty"`
Resources *apiv1alpha1.ResourcesSpec `json:"resources,omitempty"`
}

type WorkerRoleGroupSpec struct {
Replicas *int32 `json:"replicas,omitempty"`
Config *WorkerConfigSpec `json:"config,omitempty"`
PodOverride *corev1.PodTemplateSpec `json:"podOverride,omitempty"`
PodDisruptionBudget *apiv1alpha1.PodDisruptionBudgetSpec `json:"podDisruptionBudget,omitempty"`
CommandOverrides []string `json:"commandOverrides,omitempty"`
EnvOverrides map[string]string `json:"envOverrides,omitempty"`
Expand Down
54 changes: 32 additions & 22 deletions api/v1alpha1/zz_generated.deepcopy.go

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

Loading

0 comments on commit 7a11817

Please sign in to comment.