mirror of
https://github.com/arangodb/kube-arangodb.git
synced 2024-12-14 11:57:37 +00:00
GT-495 Make scale_down_candidate annotation obsolete (#1429)
This commit is contained in:
parent
411efad90a
commit
999afcbe89
5 changed files with 19 additions and 8 deletions
|
@ -11,6 +11,7 @@
|
|||
- (Maintenance) Add IndexMethod Documentation
|
||||
- (Bugfix) Fix VersionCheck args propagation
|
||||
- (Feature) EnforcedResignLeadership action
|
||||
- (Maintenance) Make scale_down_candidate annotation obsolete
|
||||
|
||||
## [1.2.33](https://github.com/arangodb/kube-arangodb/tree/1.2.33) (2023-09-27)
|
||||
- (Maintenance) Bump golang.org/x/net to v0.13.0
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
//
|
||||
// DISCLAIMER
|
||||
//
|
||||
// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany
|
||||
// Copyright 2016-2023 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.
|
||||
|
@ -21,12 +21,14 @@
|
|||
package deployment
|
||||
|
||||
const (
|
||||
ArangoDeploymentAnnotationPrefix = "deployment.arangodb.com"
|
||||
ArangoDeploymentPodMaintenanceAnnotation = ArangoDeploymentAnnotationPrefix + "/maintenance"
|
||||
ArangoDeploymentPodChangeArchAnnotation = ArangoDeploymentAnnotationPrefix + "/arch"
|
||||
ArangoDeploymentPodRotateAnnotation = ArangoDeploymentAnnotationPrefix + "/rotate"
|
||||
ArangoDeploymentPodReplaceAnnotation = ArangoDeploymentAnnotationPrefix + "/replace"
|
||||
ArangoDeploymentPodDeleteNow = ArangoDeploymentAnnotationPrefix + "/delete_now"
|
||||
ArangoDeploymentAnnotationPrefix = "deployment.arangodb.com"
|
||||
ArangoDeploymentPodMaintenanceAnnotation = ArangoDeploymentAnnotationPrefix + "/maintenance"
|
||||
ArangoDeploymentPodChangeArchAnnotation = ArangoDeploymentAnnotationPrefix + "/arch"
|
||||
ArangoDeploymentPodRotateAnnotation = ArangoDeploymentAnnotationPrefix + "/rotate"
|
||||
ArangoDeploymentPodReplaceAnnotation = ArangoDeploymentAnnotationPrefix + "/replace"
|
||||
ArangoDeploymentPodDeleteNow = ArangoDeploymentAnnotationPrefix + "/delete_now"
|
||||
ArangoDeploymentPlanCleanAnnotation = "plan." + ArangoDeploymentAnnotationPrefix + "/clean"
|
||||
|
||||
// Deprecated: use ArangoMemberSpec.DeletionPriority instead
|
||||
ArangoDeploymentPodScaleDownCandidateAnnotation = ArangoDeploymentAnnotationPrefix + "/scale_down_candidate"
|
||||
ArangoDeploymentPlanCleanAnnotation = "plan." + ArangoDeploymentAnnotationPrefix + "/clean"
|
||||
)
|
||||
|
|
|
@ -41,6 +41,9 @@ type ArangoMemberSpec struct {
|
|||
// Template keeps template which is gonna be applied on the Pod.
|
||||
Template *ArangoMemberPodTemplate `json:"template,omitempty"`
|
||||
|
||||
// DeletionPriority define Deletion Priority.
|
||||
// Higher value means higher priority. Default is 0.
|
||||
// Example: set 1 for Coordinator which should be deleted first and scale down coordinators by one.
|
||||
DeletionPriority *int `json:"deletion_priority,omitempty"`
|
||||
}
|
||||
|
||||
|
|
|
@ -41,6 +41,9 @@ type ArangoMemberSpec struct {
|
|||
// Template keeps template which is gonna be applied on the Pod.
|
||||
Template *ArangoMemberPodTemplate `json:"template,omitempty"`
|
||||
|
||||
// DeletionPriority define Deletion Priority.
|
||||
// Higher value means higher priority. Default is 0.
|
||||
// Example: set 1 for Coordinator which should be deleted first and scale down coordinators by one.
|
||||
DeletionPriority *int `json:"deletion_priority,omitempty"`
|
||||
}
|
||||
|
||||
|
|
|
@ -185,11 +185,13 @@ func (r *Reconciler) scaleDownCandidate(ctx context.Context, apiObject k8sutil.A
|
|||
continue
|
||||
}
|
||||
|
||||
//nolint:staticcheck
|
||||
if _, ok := am.Annotations[deployment.ArangoDeploymentPodScaleDownCandidateAnnotation]; ok {
|
||||
annotationExists = true
|
||||
}
|
||||
|
||||
if pod, ok := cache.Pod().V1().GetSimple(m.Member.Pod.GetName()); ok {
|
||||
//nolint:staticcheck
|
||||
if _, ok := pod.Annotations[deployment.ArangoDeploymentPodScaleDownCandidateAnnotation]; ok {
|
||||
annotationExists = true
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue