-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathconstants.go
More file actions
81 lines (67 loc) · 4.52 KB
/
Copy pathconstants.go
File metadata and controls
81 lines (67 loc) · 4.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
// SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and IronCore contributors
// SPDX-License-Identifier: Apache-2.0
package v1alpha1
import "github.com/stmcginnis/gofish/schemas"
// establishing general rule for constants naming for Annotations
// "Key" for Annotation constants should be named OperationAnnotation.
// we do not want to handle multiple annotation keys for outside the spec flow operations.
// "Value" for Annotation constants should be named as OperationAnnotation<ActionType>
// e.g.
// OperationAnnotationIgnore
// OperationAnnotationIgnoreChild
// OperationAnnotationIgnoreChildAndSelf
// OperationAnnotationRetry
const (
// OperationAnnotation indicates operation should be performed outside the current spec definition flow.
// This annotation performs Operation on the Server.
OperationAnnotation = "metal.ironcore.dev/operation"
// OperationAnnotationIgnore skips the reconciliation of a resource if OperationAnnotation is set to this.
OperationAnnotationIgnore = "ignore-reconciliation"
// OperationAnnotationIgnorePropagated skips the reconciliation of a resource's Child if OperationAnnotation is set to this.
OperationAnnotationIgnorePropagated = "ignore-reconciliation-propagated"
// OperationAnnotationIgnoreChild skips the reconciliation of a resource's Child if OperationAnnotation is set to this.
OperationAnnotationIgnoreChild = "ignore-child-reconciliation"
// OperationAnnotationIgnoreChildAndSelf skips the reconciliation of a resource's Child ans self if OperationAnnotation is set to this.
OperationAnnotationIgnoreChildAndSelf = "ignore-child-and-self-reconciliation"
// OperationAnnotationRetryChild restarts the reconciliation of a resource's Child if OperationAnnotation is set to this, from failed state -> initial state.
OperationAnnotationRetryChild = "retry-child-reconciliation"
// OperationAnnotationRetryChildAndSelf restarts the reconciliation of a resource's Child ans self if OperationAnnotation is set to this, from failed state -> initial state..
OperationAnnotationRetryChildAndSelf = "retry-child-and-self-reconciliation"
// AnnotationInstanceType is used to specify the type of Server.
AnnotationInstanceType = "metal.ironcore.dev/instance-type"
// OperationAnnotationForceUpdateOrDeleteInProgress allows update/Delete of a resource even if it is in progress.
OperationAnnotationForceUpdateOrDeleteInProgress = "allow-in-progress-delete"
// OperationAnnotationForceUpdateInProgress allows update of a resource even if it is in progress.
OperationAnnotationForceUpdateInProgress = "allow-in-progress-update"
// OperationAnnotationRetryFailed restarts the reconciliation of a resource from failed state -> initial state.
OperationAnnotationRetryFailed = "retry-failed-state-resource"
// OperationAnnotationRetryFailedPropagated restarts the reconciliation of a resource's child from failed state -> initial state.
OperationAnnotationRetryFailedPropagated = "retry-failed-state-resource-propagated"
// OperationAnnotationRotateCredentials is used to indicate that credentials should be rotated.
OperationAnnotationRotateCredentials = "rotate-credentials"
)
const (
// GracefulRestartServerPower indicates to gracefully restart the baremetal server power.
GracefulRestartServerPower = "graceful-restart-server"
// HardRestartServerPower indicates to hard restart the baremetal server power.
HardRestartServerPower = "hard-restart-server"
// PowerCycleServerPower indicates to power cycle the baremetal server.
PowerCycleServerPower = "power-cycle-server"
// ForceOffServerPower indicates to force powerOff the baremetal server power.
ForceOffServerPower = "force-off-server"
// ForceOnServerPower indicates to force powerOn the baremetal server power.
ForceOnServerPower = "force-on-server"
// ForceResetBMC indicates to forcefully restart the BMC (Baseboard Management Controller).
// This triggers a BMC reset operation that will attempt Redfish ForceRestart first,
// and fall back to SSH-based reset if the BMC is unresponsive (5xx errors).
// The SSH reset commands (e.g., Dell's racreset) perform forceful resets without graceful shutdown.
ForceResetBMC = "force-reset-bmc"
)
var AnnotationToRedfishMapping = map[string]schemas.ResetType{
GracefulRestartServerPower: schemas.GracefulRestartResetType,
HardRestartServerPower: schemas.ForceRestartResetType,
PowerCycleServerPower: schemas.PowerCycleResetType,
ForceOffServerPower: schemas.ForceOffResetType,
ForceOnServerPower: schemas.ForceOnResetType,
ForceResetBMC: schemas.ForceRestartResetType,
}