Skip to content

Commit

Permalink
introduce upgrade mechanism and add upgrade patch to v1 storage migra…
Browse files Browse the repository at this point in the history
…tion

Signed-off-by: Jeeva Kandasamy <[email protected]>
  • Loading branch information
jkandasa committed Sep 7, 2023
1 parent d977943 commit 6d2c7ea
Show file tree
Hide file tree
Showing 67 changed files with 887 additions and 22,519 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ replace (
k8s.io/client-go => k8s.io/client-go v0.25.9
k8s.io/code-generator => k8s.io/code-generator v0.25.9
k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20230525220651-2546d827e515
knative.dev/pkg => knative.dev/pkg v0.0.0-20230418073056-dfad48eaa5d0
knative.dev/pkg => knative.dev/pkg v0.0.0-20230718152110-aef227e72ead
)

require (
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2240,8 +2240,8 @@ k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSn
k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
knative.dev/eventing v0.38.0 h1:n6/k9IJ1kOvpZx4CMLqa1FG7g2iBiyKXwBu1Fy/81q4=
knative.dev/networking v0.0.0-20220404212543-dde40b019aff h1:pqzWi29qb44TY+5xtc9vty4mSyUYvojXZGCp0y/91eo=
knative.dev/pkg v0.0.0-20230418073056-dfad48eaa5d0 h1:EFQcoUo8I4bc+U3y6tR1B3ONYZSHWUdAfI7Vh7dae8g=
knative.dev/pkg v0.0.0-20230418073056-dfad48eaa5d0/go.mod h1:2qWPP9Gjh9Q7ETti+WRHnBnGCSCq+6q7m3p/nmUQviE=
knative.dev/pkg v0.0.0-20230718152110-aef227e72ead h1:2dDzorpKuVZW3Qp7TbirMMq16FbId8f6bacQFX8jXLw=
knative.dev/pkg v0.0.0-20230718152110-aef227e72ead/go.mod h1:WmrwRV/P+hGHoMraAEfwg6ec+fBTf+Obu41v354Iabc=
knative.dev/serving v0.30.1-0.20220402124840-21c05dc9d9a4 h1:iRFWsFKsA5ddhi+eKZVJdf8gPBomTfjIyRAKk9Uh7Ko=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
Expand Down
1 change: 1 addition & 0 deletions pkg/apis/operator/v1alpha1/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ const (
InstallerSetType = "operator.tekton.dev/type"
LabelOperandName = "operator.tekton.dev/operand-name"
DbSecretHash = "operator.tekton.dev/db-secret-hash"
LastAppliedUpgradeKey = "operator.tekton.dev/last-applied-upgrade"

UpgradePending = "upgrade pending"
Reinstalling = "reinstalling"
Expand Down
16 changes: 16 additions & 0 deletions pkg/apis/operator/v1alpha1/tektonconfig_lifecycle.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,19 @@ func (tcs *TektonConfigStatus) GetVersion() string {
func (tcs *TektonConfigStatus) SetVersion(version string) {
tcs.Version = version
}

// returns last applied upgrade version
func (tcs *TektonConfigStatus) GetLastAppliedUpgradeVersion() string {
if tcs.Annotations == nil {
return ""
}
return tcs.Annotations[LastAppliedUpgradeKey]
}

// updates last applied upgrade version
func (tcs *TektonConfigStatus) SetLastAppliedUpgradeVersion(lastAppliedUpgradeVersion string) {
if tcs.Annotations == nil {
tcs.Annotations = map[string]string{}
}
tcs.Annotations[LastAppliedUpgradeKey] = lastAppliedUpgradeVersion
}
Loading

0 comments on commit 6d2c7ea

Please sign in to comment.