Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fixed inpace update operatorVersion #559

Merged
merged 1 commit into from
Oct 22, 2024
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
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ cover.out
# tools binary files
tmp/

# go workspace
go.work
go.work.sum

# Emacs save files
*~
\#*\#
Expand Down
1 change: 1 addition & 0 deletions .licenserc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ header:
- 'playground/*'
- ".dockerignore"
- 'pkg/webhook/corevalidation/validation.go'
- '**/go.*'
comment: on-failure
10 changes: 6 additions & 4 deletions api/core/v1alpha1/common_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ const (
)

var (
LegacyOpVersion = semver.MustParse("1.2.0")
LatestOpVersion = semver.MustParse("1.3.0")
OpVersion1_2_0 = semver.MustParse("1.2.0")
OpVersion1_3_0 = semver.MustParse("1.3.0")
LatestOpVersion = OpVersion1_3_0
FirstOpVersion = OpVersion1_2_0
)

func (c *ConditionalStatus) SetCondition(condition metav1.Condition) {
Expand Down Expand Up @@ -301,11 +303,11 @@ func (p *PodSet) GetSemVer() (*semver.Version, bool) {

func (p *PodSet) GetOperatorVersion() semver.Version {
if p.OperatorVersion == nil {
return LegacyOpVersion
return FirstOpVersion
}
v, err := semver.ParseTolerant(*p.OperatorVersion)
if err != nil {
return LegacyOpVersion
return FirstOpVersion
}
return v
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@ import "github.com/blang/semver/v4"
type Gate string

var (
gateVersions = map[Gate][]semver.Version{}
gateVersions = map[Gate][]semver.Version{
GateInplaceConfigmapUpdate: {semver.MustParse("1.3.0")},
}
)

const (
GateInplaceConfigmapUpdate Gate = "InplaceConfigmapUpdate"
)

func (g Gate) Enabled(v semver.Version) bool {
Expand Down
42 changes: 22 additions & 20 deletions api/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ go 1.19
require (
github.com/blang/semver/v4 v4.0.0
github.com/go-errors/errors v1.5.1
github.com/matrixorigin/controller-runtime v0.0.0-20240516114812-aa9013774960
github.com/matrixorigin/controller-runtime v0.0.0-20240909085031-5f706d779ec6
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826
github.com/onsi/gomega v1.27.7
github.com/pelletier/go-toml v1.9.5
github.com/stretchr/testify v1.8.1
github.com/stretchr/testify v1.9.0
k8s.io/api v0.27.2
k8s.io/apimachinery v0.27.2
k8s.io/component-base v0.27.2
Expand All @@ -23,17 +23,18 @@ require (
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-logr/logr v1.3.0 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.1 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/pprof v0.0.0-20230510103437-eeec1cb781c3 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
Expand All @@ -44,21 +45,22 @@ require (
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.15.1 // indirect
github.com/prometheus/client_model v0.4.0 // indirect
github.com/prometheus/common v0.42.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
github.com/prometheus/client_golang v1.17.0 // indirect
github.com/prometheus/client_model v0.5.0 // indirect
github.com/prometheus/common v0.44.0 // indirect
github.com/prometheus/procfs v0.11.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
go.uber.org/multierr v1.8.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/oauth2 v0.5.0 // indirect
golang.org/x/sys v0.8.0 // indirect
golang.org/x/term v0.8.0 // indirect
golang.org/x/text v0.9.0 // indirect
golang.org/x/time v0.3.0 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/oauth2 v0.16.0 // indirect
golang.org/x/sys v0.21.0 // indirect
golang.org/x/term v0.20.0 // indirect
golang.org/x/text v0.17.0 // indirect
golang.org/x/time v0.5.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.3.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.30.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
Loading
Loading