Skip to content

Commit ab9873d

Browse files
authored
[Feature] High priority plan (#774)
1 parent 1422990 commit ab9873d

File tree

8 files changed

+218
-96
lines changed

8 files changed

+218
-96
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## [master](https://github.com/arangodb/kube-arangodb/tree/master) (N/A)
44
- Update 'github.com/arangodb/arangosync-client' dependency to v0.7.0
5+
- Add HighPriorityPlan to ArangoDeployment Status
56

67
## [1.2.1](https://github.com/arangodb/kube-arangodb/tree/1.2.1) (2021-07-28)
78
- Fix ArangoMember race with multiple ArangoDeployments within single namespace

pkg/apis/deployment/v1/deployment_status.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ type DeploymentStatus struct {
6363
// Plan to update this deployment
6464
Plan Plan `json:"plan,omitempty"`
6565

66+
// HighPriorityPlan to update this deployment. Executed before plan
67+
HighPriorityPlan Plan `json:"highPriorityPlan,omitempty"`
68+
6669
// AcceptedSpec contains the last specification that was accepted by the operator.
6770
AcceptedSpec *DeploymentSpec `json:"accepted-spec,omitempty"`
6871

pkg/apis/deployment/v1/plan.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,31 @@ import (
2929
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
3030
)
3131

32+
// ActionPriority define action priority
33+
type ActionPriority int
34+
35+
const (
36+
// ActionPriorityNormal define normal priority plan
37+
ActionPriorityNormal ActionPriority = iota
38+
// ActionPriorityHigh define high priority plan
39+
ActionPriorityHigh
40+
)
41+
3242
// ActionType is a strongly typed name for a plan action item
3343
type ActionType string
3444

3545
func (a ActionType) String() string {
3646
return string(a)
3747
}
3848

49+
// Priority returns plan priority
50+
func (a ActionType) Priority() ActionPriority {
51+
switch a {
52+
default:
53+
return ActionPriorityNormal
54+
}
55+
}
56+
3957
const (
4058
// ActionTypeIdle causes a plan to be recalculated.
4159
ActionTypeIdle ActionType = "Idle"

pkg/apis/deployment/v1/zz_generated.deepcopy.go

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/apis/deployment/v2alpha1/deployment_status.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ type DeploymentStatus struct {
6363
// Plan to update this deployment
6464
Plan Plan `json:"plan,omitempty"`
6565

66+
// HighPriorityPlan to update this deployment. Executed before plan
67+
HighPriorityPlan Plan `json:"highPriorityPlan,omitempty"`
68+
6669
// AcceptedSpec contains the last specification that was accepted by the operator.
6770
AcceptedSpec *DeploymentSpec `json:"accepted-spec,omitempty"`
6871

pkg/apis/deployment/v2alpha1/plan.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,31 @@ import (
2929
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
3030
)
3131

32+
// ActionPriority define action priority
33+
type ActionPriority int
34+
35+
const (
36+
// ActionPriorityNormal define normal priority plan
37+
ActionPriorityNormal ActionPriority = iota
38+
// ActionPriorityHigh define high priority plan
39+
ActionPriorityHigh
40+
)
41+
3242
// ActionType is a strongly typed name for a plan action item
3343
type ActionType string
3444

3545
func (a ActionType) String() string {
3646
return string(a)
3747
}
3848

49+
// Priority returns plan priority
50+
func (a ActionType) Priority() ActionPriority {
51+
switch a {
52+
default:
53+
return ActionPriorityNormal
54+
}
55+
}
56+
3957
const (
4058
// ActionTypeIdle causes a plan to be recalculated.
4159
ActionTypeIdle ActionType = "Idle"

pkg/apis/deployment/v2alpha1/zz_generated.deepcopy.go

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)