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