/
staticaccesskey_types.go
49 lines (40 loc) · 1.51 KB
/
staticaccesskey_types.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
47
48
49
// Copyright (c) 2021 Yandex LLC. All rights reserved.
// Author: Martynov Pavel <covariance@yandex-team.ru>
package v1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// StaticAccessKeySpec defines the desired state of StaticAccessKeySpec
type StaticAccessKeySpec struct {
// ServiceAccountID: id of service account from which the key will be issued. Must be immutable.
// +kubebuilder:validation:Required
ServiceAccountID string `json:"serviceAccountId"`
}
// StaticAccessKeyStatus defines the observed state of StaticAccessKey
type StaticAccessKeyStatus struct {
// KeyID: id of an issued key
KeyID string `json:"keyId,omitempty"`
// SecretRef: reference to a secret containing
// issued key values. It is always in the same
// namespace as the StaticAccessKey.
SecretName string `json:"secretName,omitempty"`
}
// StaticAccessKey is the Schema for the staticaccesskey API
// +kubebuilder:object:root=true
// +kubebuilder:resource:shortName=sakey
type StaticAccessKey struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec StaticAccessKeySpec `json:"spec,omitempty"`
Status StaticAccessKeyStatus `json:"status,omitempty"`
}
// StaticAccessKeyList contains a list of StaticAccessKey
// +kubebuilder:object:root=true
type StaticAccessKeyList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []StaticAccessKey `json:"items"`
}
func init() {
SchemeBuilder.Register(&StaticAccessKey{}, &StaticAccessKeyList{})
}