Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
xiedeyantu committed Sep 1, 2023
1 parent 33d1d0c commit 6993e6d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion api/doris/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ type BaseSpec struct {
PersistentVolumes []PersistentVolume `json:"persistentVolumes,omitempty"`

//SystemInitialization for fe, be and cn setting system parameters.
SystemInitialization SystemInitialization `json:"systemInitialization,omitempty"`
SystemInitialization *SystemInitialization `json:"systemInitialization,omitempty"`
}

type SystemInitialization struct {
Expand Down
6 changes: 5 additions & 1 deletion api/doris/v1/zz_generated.deepcopy.go

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

6 changes: 3 additions & 3 deletions pkg/common/utils/resource/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const (
func NewPodTemplateSpec(dcr *v1.DorisCluster, componentType v1.ComponentType) corev1.PodTemplateSpec {
spec := getBaseSpecFromCluster(dcr, componentType)
var volumes []corev1.Volume
var si v1.SystemInitialization
var si *v1.SystemInitialization
switch componentType {
case v1.Component_FE:
volumes = newVolumesFromBaseSpec(dcr.Spec.FeSpec.BaseSpec)
Expand Down Expand Up @@ -75,7 +75,7 @@ func NewPodTemplateSpec(dcr *v1.DorisCluster, componentType v1.ComponentType) co
},
}

if len(si.Command) > 0 || len(si.Args) > 0 {
if si != nil {
initContainer := newBaseInitContainer("init", si)
pts.Spec.InitContainers = append(pts.Spec.InitContainers, initContainer)
}
Expand Down Expand Up @@ -147,7 +147,7 @@ func mergeEnvs(src []corev1.EnvVar, dst []corev1.EnvVar) []corev1.EnvVar {
return dst
}

func newBaseInitContainer(name string, si v1.SystemInitialization) corev1.Container {
func newBaseInitContainer(name string, si *v1.SystemInitialization) corev1.Container {
enablePrivileged := true
c := corev1.Container{
Image: "alpine:latest",
Expand Down

0 comments on commit 6993e6d

Please sign in to comment.