Skip to content

Commit

Permalink
Add UpdateStrategy field
Browse files Browse the repository at this point in the history
  • Loading branch information
l0kix2 committed Apr 16, 2024
1 parent cf9267b commit cc59df9
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 1 deletion.
16 changes: 16 additions & 0 deletions api/v1/ytsaurus_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -543,9 +543,13 @@ type YtsaurusSpec struct {
//+kubebuilder:default:=true
//+optional
IsManaged bool `json:"isManaged"`
// EnableFullUpdate is deprecated, use UpdateStrategy instead.
// EnableFullUpdate is only considered if UpdateStrategy is empty.
//+kubebuilder:default:=true
//+optional
EnableFullUpdate bool `json:"enableFullUpdate"`
//+optional
UpdateStrategy UpdateStrategy `json:"updateStrategy"`

Bootstrap *BootstrapSpec `json:"bootstrap,omitempty"`

Expand Down Expand Up @@ -618,10 +622,22 @@ type TabletCellBundleInfo struct {
TabletCellCount int `yson:"tablet_cell_count,attr" json:"tabletCellCount"`
}

type UpdateStrategy string

const (
UpdateStrategyNone UpdateStrategy = ""
UpdateStrategyBlocked UpdateStrategy = "Blocked"
UpdateStrategyStatelessOnly UpdateStrategy = "StatelessOnly"
UpdateStrategyMasterOnly UpdateStrategy = "MasterOnly"
UpdateStrategyTabletNodesOnly UpdateStrategy = "TabletNodesOnly"
UpdateStrategyFull UpdateStrategy = "Full"
)

type UpdateStatus struct {
//+kubebuilder:default:=None
State UpdateState `json:"state,omitempty"`
Components []string `json:"components,omitempty"`
Strategy UpdateStrategy `json:"updateStrategy,omitempty"`
Conditions []metav1.Condition `json:"conditions,omitempty"`
TabletCellBundles []TabletCellBundleInfo `json:"tabletCellBundles,omitempty"`
MasterMonitoringPaths []string `json:"masterMonitoringPaths,omitempty"`
Expand Down
5 changes: 5 additions & 0 deletions config/crd/bases/cluster.ytsaurus.tech_ytsaurus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7158,6 +7158,7 @@ spec:
type: object
enableFullUpdate:
default: true
description: EnableFullUpdate is deprecated, use UpdateStrategy instead.
type: boolean
ephemeralCluster:
default: false
Expand Down Expand Up @@ -33433,6 +33434,8 @@ spec:
type: object
uiImage:
type: string
updateStrategy:
type: string
useIpv4:
default: false
type: boolean
Expand Down Expand Up @@ -35902,6 +35905,8 @@ spec:
- tabletCellCount
type: object
type: array
updateStrategy:
type: string
type: object
type: object
type: object
Expand Down
18 changes: 17 additions & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1489,11 +1489,26 @@ _Appears in:_
| --- | --- | --- | --- |
| `state` _[UpdateState](#updatestate)_ | | None | |
| `components` _string array_ | | | |
| `updateStrategy` _[UpdateStrategy](#updatestrategy)_ | | | |
| `conditions` _[Condition](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#condition-v1-meta) array_ | | | |
| `tabletCellBundles` _[TabletCellBundleInfo](#tabletcellbundleinfo) array_ | | | |
| `masterMonitoringPaths` _string array_ | | | |


#### UpdateStrategy

_Underlying type:_ _string_





_Appears in:_
- [UpdateStatus](#updatestatus)
- [YtsaurusSpec](#ytsaurusspec)



#### YQLAgentSpec


Expand Down Expand Up @@ -1576,7 +1591,8 @@ _Appears in:_
| `adminCredentials` _[LocalObjectReference](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#localobjectreference-v1-core)_ | | | |
| `oauthService` _[OauthServiceSpec](#oauthservicespec)_ | | | |
| `isManaged` _boolean_ | | true | |
| `enableFullUpdate` _boolean_ | | true | |
| `enableFullUpdate` _boolean_ | EnableFullUpdate is deprecated, use UpdateStrategy instead.<br />If UpdateStrategy is not | true | |
| `updateStrategy` _[UpdateStrategy](#updatestrategy)_ | | | |
| `bootstrap` _[BootstrapSpec](#bootstrapspec)_ | | | |
| `discovery` _[DiscoverySpec](#discoveryspec)_ | | | |
| `primaryMasters` _[MastersSpec](#mastersspec)_ | | | |
Expand Down
5 changes: 5 additions & 0 deletions ytop-chart/templates/ytsaurus-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7120,6 +7120,7 @@ spec:
type: object
enableFullUpdate:
default: true
description: EnableFullUpdate is deprecated, use UpdateStrategy instead.
type: boolean
ephemeralCluster:
default: false
Expand Down Expand Up @@ -33220,6 +33221,8 @@ spec:
type: object
uiImage:
type: string
updateStrategy:
type: string
useIpv4:
default: false
type: boolean
Expand Down Expand Up @@ -35670,6 +35673,8 @@ spec:
- tabletCellCount
type: object
type: array
updateStrategy:
type: string
type: object
type: object
type: object
Expand Down

0 comments on commit cc59df9

Please sign in to comment.