1
0
Fork 0
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:
jwierzbo 2023-10-13 16:12:54 +02:00 committed by GitHub
parent 411efad90a
commit 999afcbe89
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 19 additions and 8 deletions

View file

@ -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

View file

@ -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"
)

View file

@ -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"`
}

View file

@ -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"`
}

View file

@ -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
}