1
0
Fork 0
mirror of https://github.com/arangodb/kube-arangodb.git synced 2024-12-14 11:57:37 +00:00

[Feature] Action PlaceHolder (#1121)

This commit is contained in:
Adam Janikowski 2022-09-23 15:39:39 +02:00 committed by GitHub
parent 39532e8aa5
commit 837175813c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 97 additions and 0 deletions

View file

@ -1,6 +1,7 @@
# Change Log
## [master](https://github.com/arangodb/kube-arangodb/tree/master) (N/A)
- (Feature) Define Actions PlaceHolder
## [1.2.17](https://github.com/arangodb/kube-arangodb/tree/1.2.17) (2022-09-22)
- (Feature) Add new field to DeploymentReplicationStatus with details on DC2DC sync status=

View file

@ -41,6 +41,7 @@
| MemberRIDUpdate | 10m0s | Community & Enterprise | Update Run ID of member |
| PVCResize | 30m0s | Community & Enterprise | Start the resize procedure. Updates PVC Requests field |
| PVCResized | 15m0s | Community & Enterprise | Waits for PVC resize to be completed |
| PlaceHolder | 10m0s | Community & Enterprise | Empty placeholder action |
| RebalancerCheck | 10m0s | Enterprise Only | Check Rebalancer job progress |
| RebalancerClean | 10m0s | Enterprise Only | Cleans Rebalancer jobs |
| RebalancerGenerate | 10m0s | Enterprise Only | Generates the Rebalancer plan |
@ -121,6 +122,7 @@ spec:
MemberRIDUpdate: 10m0s
PVCResize: 30m0s
PVCResized: 15m0s
PlaceHolder: 10m0s
RebalancerCheck: 10m0s
RebalancerClean: 10m0s
RebalancerGenerate: 10m0s

View file

@ -3,6 +3,8 @@
default_timeout: 10m
actions:
PlaceHolder:
description: Empty placeholder action
Idle:
description: Define idle operation in case if preconditions are not meet
AddMember:

View file

@ -99,6 +99,8 @@ const (
ActionPVCResizeDefaultTimeout time.Duration = 1800 * time.Second // 30m0s
// ActionPVCResizedDefaultTimeout define default timeout for action ActionPVCResized
ActionPVCResizedDefaultTimeout time.Duration = 900 * time.Second // 15m0s
// ActionPlaceHolderDefaultTimeout define default timeout for action ActionPlaceHolder
ActionPlaceHolderDefaultTimeout time.Duration = ActionsDefaultTimeout
// ActionRebalancerCheckDefaultTimeout define default timeout for action ActionRebalancerCheck
ActionRebalancerCheckDefaultTimeout time.Duration = ActionsDefaultTimeout
// ActionRebalancerCleanDefaultTimeout define default timeout for action ActionRebalancerClean
@ -246,6 +248,8 @@ const (
ActionTypePVCResize ActionType = "PVCResize"
// ActionTypePVCResized in scopes Normal. Waits for PVC resize to be completed
ActionTypePVCResized ActionType = "PVCResized"
// ActionTypePlaceHolder in scopes Normal. Empty placeholder action
ActionTypePlaceHolder ActionType = "PlaceHolder"
// ActionTypeRebalancerCheck in scopes Normal. Check Rebalancer job progress
ActionTypeRebalancerCheck ActionType = "RebalancerCheck"
// ActionTypeRebalancerClean in scopes Normal. Cleans Rebalancer jobs
@ -394,6 +398,8 @@ func ActionDefaultTimeout(in ActionType) time.Duration {
return ActionPVCResizeDefaultTimeout
case ActionTypePVCResized:
return ActionPVCResizedDefaultTimeout
case ActionTypePlaceHolder:
return ActionPlaceHolderDefaultTimeout
case ActionTypeRebalancerCheck:
return ActionRebalancerCheckDefaultTimeout
case ActionTypeRebalancerClean:
@ -545,6 +551,8 @@ func GetActionPriority(in ActionType) ActionPriority {
return ActionPriorityNormal
case ActionTypePVCResized:
return ActionPriorityNormal
case ActionTypePlaceHolder:
return ActionPriorityNormal
case ActionTypeRebalancerCheck:
return ActionPriorityNormal
case ActionTypeRebalancerClean:

View file

@ -99,6 +99,8 @@ const (
ActionPVCResizeDefaultTimeout time.Duration = 1800 * time.Second // 30m0s
// ActionPVCResizedDefaultTimeout define default timeout for action ActionPVCResized
ActionPVCResizedDefaultTimeout time.Duration = 900 * time.Second // 15m0s
// ActionPlaceHolderDefaultTimeout define default timeout for action ActionPlaceHolder
ActionPlaceHolderDefaultTimeout time.Duration = ActionsDefaultTimeout
// ActionRebalancerCheckDefaultTimeout define default timeout for action ActionRebalancerCheck
ActionRebalancerCheckDefaultTimeout time.Duration = ActionsDefaultTimeout
// ActionRebalancerCleanDefaultTimeout define default timeout for action ActionRebalancerClean
@ -246,6 +248,8 @@ const (
ActionTypePVCResize ActionType = "PVCResize"
// ActionTypePVCResized in scopes Normal. Waits for PVC resize to be completed
ActionTypePVCResized ActionType = "PVCResized"
// ActionTypePlaceHolder in scopes Normal. Empty placeholder action
ActionTypePlaceHolder ActionType = "PlaceHolder"
// ActionTypeRebalancerCheck in scopes Normal. Check Rebalancer job progress
ActionTypeRebalancerCheck ActionType = "RebalancerCheck"
// ActionTypeRebalancerClean in scopes Normal. Cleans Rebalancer jobs
@ -394,6 +398,8 @@ func ActionDefaultTimeout(in ActionType) time.Duration {
return ActionPVCResizeDefaultTimeout
case ActionTypePVCResized:
return ActionPVCResizedDefaultTimeout
case ActionTypePlaceHolder:
return ActionPlaceHolderDefaultTimeout
case ActionTypeRebalancerCheck:
return ActionRebalancerCheckDefaultTimeout
case ActionTypeRebalancerClean:
@ -545,6 +551,8 @@ func GetActionPriority(in ActionType) ActionPriority {
return ActionPriorityNormal
case ActionTypePVCResized:
return ActionPriorityNormal
case ActionTypePlaceHolder:
return ActionPriorityNormal
case ActionTypeRebalancerCheck:
return ActionPriorityNormal
case ActionTypeRebalancerClean:

View file

@ -138,6 +138,9 @@ var (
_ Action = &actionPVCResized{}
_ actionFactory = newPVCResizedAction
_ Action = &actionPlaceHolder{}
_ actionFactory = newPlaceHolderAction
_ Action = &actionRebalancerCheck{}
_ actionFactory = newRebalancerCheckAction
@ -691,6 +694,18 @@ func init() {
registerAction(action, function)
}
// PlaceHolder
{
// Get Action defition
function := newPlaceHolderAction
action := api.ActionTypePlaceHolder
// Wrap action main function
// Register action
registerAction(action, function)
}
// RebalancerCheck
{
// Get Action defition

View file

@ -178,6 +178,10 @@ func Test_Actions(t *testing.T) {
ActionsExistence(t, api.ActionTypePVCResized)
})
t.Run("PlaceHolder", func(t *testing.T) {
ActionsExistence(t, api.ActionTypePlaceHolder)
})
t.Run("RebalancerCheck", func(t *testing.T) {
ActionsExistence(t, api.ActionTypeRebalancerCheck)
})

View file

@ -0,0 +1,26 @@
//
// DISCLAIMER
//
// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//go:build !enterprise
// +build !enterprise
package reconcile
type actionPlaceHolder struct {
actionEmpty
}

View file

@ -0,0 +1,31 @@
//
// DISCLAIMER
//
// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//
package reconcile
import api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1"
func newPlaceHolderAction(action api.Action, actionCtx ActionContext) Action {
a := &actionPlaceHolder{}
a.actionImpl = newActionImplDefRef(action, actionCtx)
return a
}