-
Notifications
You must be signed in to change notification settings - Fork 113
/
annotations.go
46 lines (34 loc) · 1.05 KB
/
annotations.go
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
package gardener
import (
gardener_types "github.com/gardener/gardener/pkg/apis/core/v1beta1"
)
const (
auditLogsAnnotation = "custom.shoot.sapcloud.io/subaccountId"
)
type ProvisioningState string
func (s ProvisioningState) String() string {
return string(s)
}
type KymaInstallationState string
func (s KymaInstallationState) String() string {
return string(s)
}
const (
runtimeIDAnnotation string = "kcp.provisioner.kyma-project.io/runtime-id"
operationIDAnnotation string = "kcp.provisioner.kyma-project.io/operation-id"
legacyRuntimeIDAnnotation string = "compass.provisioner.kyma-project.io/runtime-id"
legacyOperationIDAnnotation string = "compass.provisioner.kyma-project.io/operation-id"
)
func annotate(shoot *gardener_types.Shoot, annotation, value string) {
if shoot.Annotations == nil {
shoot.Annotations = map[string]string{}
}
shoot.Annotations[annotation] = value
}
func getRuntimeId(shoot gardener_types.Shoot) string {
runtimeID, found := shoot.Annotations[runtimeIDAnnotation]
if !found {
return ""
}
return runtimeID
}