Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ $(GOBUILDDIR):
@mkdir -p $(ORGDIR)
@rm -f $(REPODIR) && ln -sf ../../../.. $(REPODIR)
GOPATH=$(GOBUILDDIR) $(PULSAR) go flatten -V $(VENDORDIR)
# Note: Next library is not vendored, since we always want the latest version
GOPATH=$(GOBUILDDIR) go get github.com/arangodb/go-upgrade-rules

$(CACHEVOL):
@docker volume create $(CACHEVOL)
Expand Down
5 changes: 3 additions & 2 deletions pkg/deployment/reconcile/plan_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ package reconcile
import (
"strings"

upgraderules "github.com/arangodb/go-upgrade-rules"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"k8s.io/api/core/v1"
Expand Down Expand Up @@ -215,11 +216,11 @@ func podNeedsUpgrading(p v1.Pod, spec api.DeploymentSpec, images api.ImageInfoLi
// Image changed, check if change is allowed
specVersion := specImageInfo.ArangoDBVersion
podVersion := podImageInfo.ArangoDBVersion
if specVersion.Major() != podVersion.Major() {
if err := upgraderules.CheckUpgradeRules(podVersion, specVersion); err != nil {
// E.g. 3.x -> 4.x, we cannot allow automatically
return upgradeDecision{UpgradeNeeded: true, UpgradeAllowed: false}
}
if specVersion.Minor() != podVersion.Minor() {
if specVersion.Major() != podVersion.Major() || specVersion.Minor() != podVersion.Minor() {
// Is allowed, with `--database.auto-upgrade`
return upgradeDecision{
UpgradeNeeded: true,
Expand Down