1package v1alpha1
2
3import "cue.dev/x/k8s.io/apimachinery/pkg/apis/meta/v1"
4
5// An API server instance reports the version it can decode and
6// the version it encodes objects to when persisting objects in
7// the backend.
8#ServerStorageVersion: {
9 // The ID of the reporting API server.
10 "apiServerID"?: string
11
12 // The API server can decode objects encoded in these versions.
13 // The encodingVersion must be included in the decodableVersions.
14 "decodableVersions"?: [...string]
15
16 // The API server encodes the object to this version when
17 // persisting it in the backend (e.g., etcd).
18 "encodingVersion"?: string
19
20 // The API server can serve these versions. DecodableVersions must
21 // include all ServedVersions.
22 "servedVersions"?: [...string]
23}
24
25// Storage version of a specific resource.
26#StorageVersion: {
27 // APIVersion defines the versioned schema of this representation
28 // of an object. Servers should convert recognized schemas to the
29 // latest internal value, and may reject unrecognized values.
30 // More info:
31 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
32 "apiVersion": "internal.apiserver.k8s.io/v1alpha1"
33
34 // Kind is a string value representing the REST resource this
35 // object represents. Servers may infer this from the endpoint
36 // the client submits requests to. Cannot be updated. In
37 // CamelCase. More info:
38 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
39 "kind": "StorageVersion"
40
41 // The name is <group>.<resource>.
42 "metadata"?: v1.#ObjectMeta
43
44 // Spec is an empty spec. It is here to comply with Kubernetes API
45 // style.
46 "spec"!: #StorageVersionSpec
47
48 // API server instances report the version they can decode and the
49 // version they encode objects to when persisting objects in the
50 // backend.
51 "status"!: #StorageVersionStatus
52}
53
54// Describes the state of the storageVersion at a certain point.
55#StorageVersionCondition: {
56 // Last time the condition transitioned from one status to
57 // another.
58 "lastTransitionTime"?: v1.#Time
59
60 // A human readable message indicating details about the
61 // transition.
62 "message"!: string
63
64 // If set, this represents the .metadata.generation that the
65 // condition was set based upon.
66 "observedGeneration"?: int64 & int
67
68 // The reason for the condition's last transition.
69 "reason"!: string
70
71 // Status of the condition, one of True, False, Unknown.
72 "status"!: string
73
74 // Type of the condition.
75 "type"!: string
76}
77
78// A list of StorageVersions.
79#StorageVersionList: {
80 // APIVersion defines the versioned schema of this representation
81 // of an object. Servers should convert recognized schemas to the
82 // latest internal value, and may reject unrecognized values.
83 // More info:
84 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
85 "apiVersion": "internal.apiserver.k8s.io/v1alpha1"
86
87 // Items holds a list of StorageVersion
88 "items"!: [...#StorageVersion]
89
90 // Kind is a string value representing the REST resource this
91 // object represents. Servers may infer this from the endpoint
92 // the client submits requests to. Cannot be updated. In
93 // CamelCase. More info:
94 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
95 "kind": "StorageVersionList"
96
97 // Standard list metadata. More info:
98 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
99 "metadata"?: v1.#ListMeta
100}
101
102// StorageVersionSpec is an empty spec.
103#StorageVersionSpec: {}
104
105// API server instances report the versions they can decode and
106// the version they encode objects to when persisting objects in
107// the backend.
108#StorageVersionStatus: {
109 // If all API server instances agree on the same encoding storage
110 // version, then this field is set to that version. Otherwise
111 // this field is left empty. API servers should finish updating
112 // its storageVersionStatus entry before serving write
113 // operations, so that this field will be in sync with the
114 // reality.
115 "commonEncodingVersion"?: string
116
117 // The latest available observations of the storageVersion's
118 // state.
119 "conditions"?: [...#StorageVersionCondition]
120
121 // The reported versions per API server instance.
122 "storageVersions"?: [...#ServerStorageVersion]
123}