Skip to content

Commit

Permalink
Strategy = selector + flow
Browse files Browse the repository at this point in the history
  • Loading branch information
l0kix2 committed Apr 18, 2024
1 parent 9bd180b commit ddb402d
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 34 deletions.
33 changes: 22 additions & 11 deletions api/v1/ytsaurus_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -547,9 +547,9 @@ type YtsaurusSpec struct {
//+optional
EnableFullUpdate bool `json:"enableFullUpdate"`
//+optional
// UpdateStrategy is an experimental field. Behaviour may change.
// If UpdateStrategy is not empty EnableFullUpdate is ignored.
UpdateStrategy UpdateStrategy `json:"updateStrategy"`
// UpdateSelector is an experimental field. Behaviour may change.
// If UpdateSelector is not empty EnableFullUpdate is ignored.
UpdateSelector UpdateSelector `json:"updateSelector"`

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

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

type UpdateStrategy string
type UpdateSelector string

const (
UpdateStrategyNone UpdateStrategy = ""
UpdateStrategyBlocked UpdateStrategy = "Blocked"
UpdateStrategyStatelessOnly UpdateStrategy = "StatelessOnly"
UpdateStrategyMasterOnly UpdateStrategy = "MasterOnly"
UpdateStrategyTabletNodesOnly UpdateStrategy = "TabletNodesOnly"
UpdateStrategyFull UpdateStrategy = "Full"
UpdateSelectorNone UpdateSelector = ""
UpdateSelectorNothing UpdateSelector = "Nothing"
UpdateSelectorStatelessOnly UpdateSelector = "StatelessOnly"
UpdateSelectorMasterOnly UpdateSelector = "MasterOnly"
UpdateSelectorTabletNodesOnly UpdateSelector = "TabletNodesOnly"
UpdateSelectorExecNodesOnly UpdateSelector = "ExecNodesOnly"
UpdateSelectorEverything UpdateSelector = "Everything"
)

type UpdateFlow string

const (
UpdateFlowNone UpdateFlow = ""
UpdateFlowStateless UpdateFlow = "Stateless"
UpdateFlowMaster UpdateFlow = "Master"
UpdateFlowTabletNodes UpdateFlow = "TabletNodes"
UpdateFlowFull UpdateFlow = "Full"
)

type UpdateStatus struct {
//+kubebuilder:default:=None
State UpdateState `json:"state,omitempty"`
Components []string `json:"components,omitempty"`
Strategy UpdateStrategy `json:"updateStrategy,omitempty"`
Flow UpdateFlow `json:"flow,omitempty"`
Conditions []metav1.Condition `json:"conditions,omitempty"`
TabletCellBundles []TabletCellBundleInfo `json:"tabletCellBundles,omitempty"`
MasterMonitoringPaths []string `json:"masterMonitoringPaths,omitempty"`
Expand Down
8 changes: 4 additions & 4 deletions config/crd/bases/cluster.ytsaurus.tech_ytsaurus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33433,8 +33433,8 @@ spec:
type: object
uiImage:
type: string
updateStrategy:
description: UpdateStrategy is an experimental field. Behaviour may
updateSelector:
description: UpdateSelector is an experimental field. Behaviour may
change.
type: string
useIpv4:
Expand Down Expand Up @@ -35887,6 +35887,8 @@ spec:
- type
type: object
type: array
flow:
type: string
masterMonitoringPaths:
items:
type: string
Expand All @@ -35906,8 +35908,6 @@ spec:
- tabletCellCount
type: object
type: array
updateStrategy:
type: string
type: object
type: object
type: object
Expand Down
42 changes: 27 additions & 15 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1461,7 +1461,7 @@ _Appears in:_
| `group` _string_ | | | |


#### UpdateState
#### UpdateFlow

_Underlying type:_ _string_

Expand All @@ -1474,28 +1474,20 @@ _Appears in:_



#### UpdateStatus

#### UpdateSelector

_Underlying type:_ _string_





_Appears in:_
- [YtsaurusStatus](#ytsaurusstatus)
- [YtsaurusSpec](#ytsaurusspec)

| Field | Description | Default | Validation |
| --- | --- | --- | --- |
| `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
#### UpdateState

_Underlying type:_ _string_

Expand All @@ -1505,10 +1497,30 @@ _Underlying type:_ _string_

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



#### UpdateStatus







_Appears in:_
- [YtsaurusStatus](#ytsaurusstatus)

| Field | Description | Default | Validation |
| --- | --- | --- | --- |
| `state` _[UpdateState](#updatestate)_ | | None | |
| `components` _string array_ | | | |
| `flow` _[UpdateFlow](#updateflow)_ | | | |
| `conditions` _[Condition](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#condition-v1-meta) array_ | | | |
| `tabletCellBundles` _[TabletCellBundleInfo](#tabletcellbundleinfo) array_ | | | |
| `masterMonitoringPaths` _string array_ | | | |


#### YQLAgentSpec


Expand Down Expand Up @@ -1592,7 +1604,7 @@ _Appears in:_
| `oauthService` _[OauthServiceSpec](#oauthservicespec)_ | | | |
| `isManaged` _boolean_ | | true | |
| `enableFullUpdate` _boolean_ | | true | |
| `updateStrategy` _[UpdateStrategy](#updatestrategy)_ | UpdateStrategy is an experimental field. Behaviour may change.<br />If UpdateStrategy is not empty EnableFullUpdate is ignored. | | |
| `updateSelector` _[UpdateSelector](#updateselector)_ | UpdateSelector is an experimental field. Behaviour may change.<br />If UpdateSelector is not empty EnableFullUpdate is ignored. | | |
| `bootstrap` _[BootstrapSpec](#bootstrapspec)_ | | | |
| `discovery` _[DiscoverySpec](#discoveryspec)_ | | | |
| `primaryMasters` _[MastersSpec](#mastersspec)_ | | | |
Expand Down
8 changes: 4 additions & 4 deletions ytop-chart/templates/ytsaurus-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33220,8 +33220,8 @@ spec:
type: object
uiImage:
type: string
updateStrategy:
description: UpdateStrategy is an experimental field. Behaviour may
updateSelector:
description: UpdateSelector is an experimental field. Behaviour may
change.
type: string
useIpv4:
Expand Down Expand Up @@ -35655,6 +35655,8 @@ spec:
- type
type: object
type: array
flow:
type: string
masterMonitoringPaths:
items:
type: string
Expand All @@ -35674,8 +35676,6 @@ spec:
- tabletCellCount
type: object
type: array
updateStrategy:
type: string
type: object
type: object
type: object
Expand Down

0 comments on commit ddb402d

Please sign in to comment.