Skip to content

Commit 62994d1

Browse files
committed
Fix
1 parent 7004d44 commit 62994d1

File tree

4 files changed

+20
-3
lines changed

4 files changed

+20
-3
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ $(BIN): $(VBIN_LINUX_AMD64) $(VBIN_OPS_LINUX_AMD64) $(VBIN_INT_LINUX_AMD64)
475475
@cp "$(VBIN_OPS_LINUX_AMD64)" "$(BIN_OPS)"
476476

477477
.PHONY: docker
478-
docker: check-vars $(VBIN_LINUX_AMD64) $(VBIN_LINUX_ARM64)
478+
docker: clean check-vars $(VBIN_LINUX_AMD64) $(VBIN_LINUX_ARM64)
479479
ifdef PUSHIMAGES
480480
docker buildx build --no-cache -f $(DOCKERFILE) --build-arg GOVERSION=$(GOVERSION) --build-arg DISTRIBUTION=$(DISTRIBUTION) \
481481
--build-arg "VERSION=${VERSION_MAJOR_MINOR_PATCH}" --build-arg "RELEASE_MODE=$(RELEASE_MODE)" \

pkg/apis/deployment/v1/deployment_spec.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,11 @@ func (s *DeploymentSpec) SetDefaults(deploymentName string) {
436436
if s.GetImagePullPolicy() == "" {
437437
s.ImagePullPolicy = util.NewType[core.PullPolicy](core.PullIfNotPresent)
438438
}
439+
if s.Gateway.IsEnabled() {
440+
if s.Gateways == nil {
441+
s.Gateways = &ServerGroupSpec{}
442+
}
443+
}
439444
s.ExternalAccess.SetDefaults()
440445
s.RocksDB.SetDefaults()
441446
s.Authentication.SetDefaults(deploymentName + "-jwt")
@@ -574,7 +579,7 @@ func (s *DeploymentSpec) Validate() error {
574579
if err := s.Architecture.Validate(); err != nil {
575580
return errors.WithStack(errors.Wrap(err, "spec.architecture"))
576581
}
577-
if err := s.Architecture.Validate(); err != nil {
582+
if err := s.Gateway.Validate(); err != nil {
578583
return errors.WithStack(errors.Wrap(err, "spec.architecture"))
579584
}
580585
return nil

pkg/apis/deployment/v2alpha1/deployment_spec.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,11 @@ func (s *DeploymentSpec) SetDefaults(deploymentName string) {
436436
if s.GetImagePullPolicy() == "" {
437437
s.ImagePullPolicy = util.NewType[core.PullPolicy](core.PullIfNotPresent)
438438
}
439+
if s.Gateway.IsEnabled() {
440+
if s.Gateways == nil {
441+
s.Gateways = &ServerGroupSpec{}
442+
}
443+
}
439444
s.ExternalAccess.SetDefaults()
440445
s.RocksDB.SetDefaults()
441446
s.Authentication.SetDefaults(deploymentName + "-jwt")
@@ -574,7 +579,7 @@ func (s *DeploymentSpec) Validate() error {
574579
if err := s.Architecture.Validate(); err != nil {
575580
return errors.WithStack(errors.Wrap(err, "spec.architecture"))
576581
}
577-
if err := s.Architecture.Validate(); err != nil {
582+
if err := s.Gateway.Validate(); err != nil {
578583
return errors.WithStack(errors.Wrap(err, "spec.architecture"))
579584
}
580585
return nil

pkg/operator/operator_deployment.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,13 @@ func (o *Operator) handleDeploymentEvent(event *Event) error {
149149
return errors.WithStack(errors.Errorf("ignore failed deployment (%s). Please delete its CR", apiObject.Name))
150150
}
151151

152+
defer func() {
153+
// recover() will return nil if there's no panic
154+
if r := recover(); r != nil {
155+
o.log.Error("Recovered from panic:", r)
156+
}
157+
}()
158+
152159
switch event.Type {
153160
case kwatch.Added:
154161
if _, ok := o.deployments[apiObject.Name]; ok {

0 commit comments

Comments
 (0)