| 1 |
/* |
| 2 |
Copyright 2015 The Kubernetes Authors. |
| 3 |
|
| 4 |
Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 |
you may not use this file except in compliance with the License. |
| 6 |
You may obtain a copy of the License at |
| 7 |
|
| 8 |
http://www.apache.org/licenses/LICENSE-2.0 |
| 9 |
|
| 10 |
Unless required by applicable law or agreed to in writing, software |
| 11 |
distributed under the License is distributed on an "AS IS" BASIS, |
| 12 |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 |
See the License for the specific language governing permissions and |
| 14 |
limitations under the License. |
| 15 |
*/ |
| 16 |
|
| 17 |
// Package v1 contains API types that are common to all versions. |
| 18 |
// |
| 19 |
// The package contains two categories of types: |
| 20 |
// - external (serialized) types that lack their own version (e.g TypeMeta) |
| 21 |
// - internal (never-serialized) types that are needed by several different |
| 22 |
// api groups, and so live here, to avoid duplication and/or import loops |
| 23 |
// (e.g. LabelSelector). |
| 24 |
// |
| 25 |
// In the future, we will probably move these categories of objects into |
| 26 |
// separate packages. |
| 27 |
package v1 |
| 28 |
|
| 29 |
import ( |
| 30 |
"fmt" |
| 31 |
"strings" |
| 32 |
|
| 33 |
"k8s.io/apimachinery/pkg/runtime" |
| 34 |
"k8s.io/apimachinery/pkg/types" |
| 35 |
) |
| 36 |
|
| 37 |
// TypeMeta describes an individual object in an API response or request |
| 38 |
// with strings representing the type of the object and its API schema version. |
| 39 |
// Structures that are versioned or persisted should inline TypeMeta. |
| 40 |
// |
| 41 |
// +k8s:deepcopy-gen=false |
| 42 |
type TypeMeta struct { |
| 43 |
// Kind is a string value representing the REST resource this object represents. |
| 44 |
// Servers may infer this from the endpoint the client submits requests to. |
| 45 |
// Cannot be updated. |
| 46 |
// In CamelCase. |
| 47 |
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds |
| 48 |
// +optional |
| 49 |
Kind string `json:"kind,omitempty" protobuf:"bytes,1,opt,name=kind"` |
| 50 |
|
| 51 |
// APIVersion defines the versioned schema of this representation of an object. |
| 52 |
// Servers should convert recognized schemas to the latest internal value, and |
| 53 |
// may reject unrecognized values. |
| 54 |
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources |
| 55 |
// +optional |
| 56 |
APIVersion string `json:"apiVersion,omitempty" protobuf:"bytes,2,opt,name=apiVersion"` |
| 57 |
} |
| 58 |
|
| 59 |
// ListMeta describes metadata that synthetic resources must have, including lists and |
| 60 |
// various status objects. A resource may have only one of {ObjectMeta, ListMeta}. |
| 61 |
type ListMeta struct { |
| 62 |
// Deprecated: selfLink is a legacy read-only field that is no longer populated by the system. |
| 63 |
// +optional |
| 64 |
SelfLink string `json:"selfLink,omitempty" protobuf:"bytes,1,opt,name=selfLink"` |
| 65 |
|
| 66 |
// String that identifies the server's internal version of this object that |
| 67 |
// can be used by clients to determine when objects have changed. |
| 68 |
// Value must be treated as opaque by clients and passed unmodified back to the server. |
| 69 |
// Populated by the system. |
| 70 |
// Read-only. |
| 71 |
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency |
| 72 |
// +optional |
| 73 |
ResourceVersion string `json:"resourceVersion,omitempty" protobuf:"bytes,2,opt,name=resourceVersion"` |
| 74 |
|
| 75 |
// continue may be set if the user set a limit on the number of items returned, and indicates that |
| 76 |
// the server has more data available. The value is opaque and may be used to issue another request |
| 77 |
// to the endpoint that served this list to retrieve the next set of available objects. Continuing a |
| 78 |
// consistent list may not be possible if the server configuration has changed or more than a few |
| 79 |
// minutes have passed. The resourceVersion field returned when using this continue value will be |
| 80 |
// identical to the value in the first response, unless you have received this token from an error |
| 81 |
// message. |
| 82 |
Continue string `json:"continue,omitempty" protobuf:"bytes,3,opt,name=continue"` |
| 83 |
|
| 84 |
// remainingItemCount is the number of subsequent items in the list which are not included in this |
| 85 |
// list response. If the list request contained label or field selectors, then the number of |
| 86 |
// remaining items is unknown and the field will be left unset and omitted during serialization. |
| 87 |
// If the list is complete (either because it is not chunking or because this is the last chunk), |
| 88 |
// then there are no more remaining items and this field will be left unset and omitted during |
| 89 |
// serialization. |
| 90 |
// Servers older than v1.15 do not set this field. |
| 91 |
// The intended use of the remainingItemCount is *estimating* the size of a collection. Clients |
| 92 |
// should not rely on the remainingItemCount to be set or to be exact. |
| 93 |
// +optional |
| 94 |
RemainingItemCount *int64 `json:"remainingItemCount,omitempty" protobuf:"bytes,4,opt,name=remainingItemCount"` |
| 95 |
} |
| 96 |
|
| 97 |
// Field path constants that are specific to the internal API |
| 98 |
// representation. |
| 99 |
const ( |
| 100 |
ObjectNameField = "metadata.name" |
| 101 |
) |
| 102 |
|
| 103 |
// These are internal finalizer values for Kubernetes-like APIs, must be qualified name unless defined here |
| 104 |
const ( |
| 105 |
FinalizerOrphanDependents = "orphan" |
| 106 |
FinalizerDeleteDependents = "foregroundDeletion" |
| 107 |
) |
| 108 |
|
| 109 |
// ObjectMeta is metadata that all persisted resources must have, which includes all objects |
| 110 |
// users must create. |
| 111 |
type ObjectMeta struct { |
| 112 |
// Name must be unique within a namespace. Is required when creating resources, although |
| 113 |
// some resources may allow a client to request the generation of an appropriate name |
| 114 |
// automatically. Name is primarily intended for creation idempotence and configuration |
| 115 |
// definition. |
| 116 |
// Cannot be updated. |
| 117 |
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names |
| 118 |
// +optional |
| 119 |
Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"` |
| 120 |
|
| 121 |
// GenerateName is an optional prefix, used by the server, to generate a unique |
| 122 |
// name ONLY IF the Name field has not been provided. |
| 123 |
// If this field is used, the name returned to the client will be different |
| 124 |
// than the name passed. This value will also be combined with a unique suffix. |
| 125 |
// The provided value has the same validation rules as the Name field, |
| 126 |
// and may be truncated by the length of the suffix required to make the value |
| 127 |
// unique on the server. |
| 128 |
// |
| 129 |
// If this field is specified and the generated name exists, the server will return a 409. |
| 130 |
// |
| 131 |
// Applied only if Name is not specified. |
| 132 |
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency |
| 133 |
// +optional |
| 134 |
GenerateName string `json:"generateName,omitempty" protobuf:"bytes,2,opt,name=generateName"` |
| 135 |
|
| 136 |
// Namespace defines the space within which each name must be unique. An empty namespace is |
| 137 |
// equivalent to the "default" namespace, but "default" is the canonical representation. |
| 138 |
// Not all objects are required to be scoped to a namespace - the value of this field for |
| 139 |
// those objects will be empty. |
| 140 |
// |
| 141 |
// Must be a DNS_LABEL. |
| 142 |
// Cannot be updated. |
| 143 |
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces |
| 144 |
// +optional |
| 145 |
Namespace string `json:"namespace,omitempty" protobuf:"bytes,3,opt,name=namespace"` |
| 146 |
|
| 147 |
// Deprecated: selfLink is a legacy read-only field that is no longer populated by the system. |
| 148 |
// +optional |
| 149 |
SelfLink string `json:"selfLink,omitempty" protobuf:"bytes,4,opt,name=selfLink"` |
| 150 |
|
| 151 |
// UID is the unique in time and space value for this object. It is typically generated by |
| 152 |
// the server on successful creation of a resource and is not allowed to change on PUT |
| 153 |
// operations. |
| 154 |
// |
| 155 |
// Populated by the system. |
| 156 |
// Read-only. |
| 157 |
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids |
| 158 |
// +optional |
| 159 |
UID types.UID `json:"uid,omitempty" protobuf:"bytes,5,opt,name=uid,casttype=k8s.io/kubernetes/pkg/types.UID"` |
| 160 |
|
| 161 |
// An opaque value that represents the internal version of this object that can |
| 162 |
// be used by clients to determine when objects have changed. May be used for optimistic |
| 163 |
// concurrency, change detection, and the watch operation on a resource or set of resources. |
| 164 |
// Clients must treat these values as opaque and passed unmodified back to the server. |
| 165 |
// They may only be valid for a particular resource or set of resources. |
| 166 |
// |
| 167 |
// Populated by the system. |
| 168 |
// Read-only. |
| 169 |
// Value must be treated as opaque by clients and . |
| 170 |
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency |
| 171 |
// +optional |
| 172 |
ResourceVersion string `json:"resourceVersion,omitempty" protobuf:"bytes,6,opt,name=resourceVersion"` |
| 173 |
|
| 174 |
// A sequence number representing a specific generation of the desired state. |
| 175 |
// Populated by the system. Read-only. |
| 176 |
// +optional |
| 177 |
Generation int64 `json:"generation,omitempty" protobuf:"varint,7,opt,name=generation"` |
| 178 |
|
| 179 |
// CreationTimestamp is a timestamp representing the server time when this object was |
| 180 |
// created. It is not guaranteed to be set in happens-before order across separate operations. |
| 181 |
// Clients may not set this value. It is represented in RFC3339 form and is in UTC. |
| 182 |
// |
| 183 |
// Populated by the system. |
| 184 |
// Read-only. |
| 185 |
// Null for lists. |
| 186 |
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata |
| 187 |
// +optional |
| 188 |
CreationTimestamp Time `json:"creationTimestamp,omitempty" protobuf:"bytes,8,opt,name=creationTimestamp"` |
| 189 |
|
| 190 |
// DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This |
| 191 |
// field is set by the server when a graceful deletion is requested by the user, and is not |
| 192 |
// directly settable by a client. The resource is expected to be deleted (no longer visible |
| 193 |
// from resource lists, and not reachable by name) after the time in this field, once the |
| 194 |
// finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. |
| 195 |
// Once the deletionTimestamp is set, this value may not be unset or be set further into the |
| 196 |
// future, although it may be shortened or the resource may be deleted prior to this time. |
| 197 |
// For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react |
| 198 |
// by sending a graceful termination signal to the containers in the pod. After that 30 seconds, |
| 199 |
// the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, |
| 200 |
// remove the pod from the API. In the presence of network partitions, this object may still |
| 201 |
// exist after this timestamp, until an administrator or automated process can determine the |
| 202 |
// resource is fully terminated. |
| 203 |
// If not set, graceful deletion of the object has not been requested. |
| 204 |
// |
| 205 |
// Populated by the system when a graceful deletion is requested. |
| 206 |
// Read-only. |
| 207 |
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata |
| 208 |
// +optional |
| 209 |
DeletionTimestamp *Time `json:"deletionTimestamp,omitempty" protobuf:"bytes,9,opt,name=deletionTimestamp"` |
| 210 |
|
| 211 |
// Number of seconds allowed for this object to gracefully terminate before |
| 212 |
// it will be removed from the system. Only set when deletionTimestamp is also set. |
| 213 |
// May only be shortened. |
| 214 |
// Read-only. |
| 215 |
// +optional |
| 216 |
DeletionGracePeriodSeconds *int64 `json:"deletionGracePeriodSeconds,omitempty" protobuf:"varint,10,opt,name=deletionGracePeriodSeconds"` |
| 217 |
|
| 218 |
// Map of string keys and values that can be used to organize and categorize |
| 219 |
// (scope and select) objects. May match selectors of replication controllers |
| 220 |
// and services. |
| 221 |
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels |
| 222 |
// +optional |
| 223 |
Labels map[string]string `json:"labels,omitempty" protobuf:"bytes,11,rep,name=labels"` |
| 224 |
|
| 225 |
// Annotations is an unstructured key value map stored with a resource that may be |
| 226 |
// set by external tools to store and retrieve arbitrary metadata. They are not |
| 227 |
// queryable and should be preserved when modifying objects. |
| 228 |
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations |
| 229 |
// +optional |
| 230 |
Annotations map[string]string `json:"annotations,omitempty" protobuf:"bytes,12,rep,name=annotations"` |
| 231 |
|
| 232 |
// List of objects depended by this object. If ALL objects in the list have |
| 233 |
// been deleted, this object will be garbage collected. If this object is managed by a controller, |
| 234 |
// then an entry in this list will point to this controller, with the controller field set to true. |
| 235 |
// There cannot be more than one managing controller. |
| 236 |
// +optional |
| 237 |
// +patchMergeKey=uid |
| 238 |
// +patchStrategy=merge |
| 239 |
// +listType=map |
| 240 |
// +listMapKey=uid |
| 241 |
OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" patchStrategy:"merge" patchMergeKey:"uid" protobuf:"bytes,13,rep,name=ownerReferences"` |
| 242 |
|
| 243 |
// Must be empty before the object is deleted from the registry. Each entry |
| 244 |
// is an identifier for the responsible component that will remove the entry |
| 245 |
// from the list. If the deletionTimestamp of the object is non-nil, entries |
| 246 |
// in this list can only be removed. |
| 247 |
// Finalizers may be processed and removed in any order. Order is NOT enforced |
| 248 |
// because it introduces significant risk of stuck finalizers. |
| 249 |
// finalizers is a shared field, any actor with permission can reorder it. |
| 250 |
// If the finalizer list is processed in order, then this can lead to a situation |
| 251 |
// in which the component responsible for the first finalizer in the list is |
| 252 |
// waiting for a signal (field value, external system, or other) produced by a |
| 253 |
// component responsible for a finalizer later in the list, resulting in a deadlock. |
| 254 |
// Without enforced ordering finalizers are free to order amongst themselves and |
| 255 |
// are not vulnerable to ordering changes in the list. |
| 256 |
// +optional |
| 257 |
// +patchStrategy=merge |
| 258 |
// +listType=set |
| 259 |
Finalizers []string `json:"finalizers,omitempty" patchStrategy:"merge" protobuf:"bytes,14,rep,name=finalizers"` |
| 260 |
|
| 261 |
// Tombstone: ClusterName was a legacy field that was always cleared by |
| 262 |
// the system and never used. |
| 263 |
// ClusterName string `json:"clusterName,omitempty" protobuf:"bytes,15,opt,name=clusterName"` |
| 264 |
|
| 265 |
// ManagedFields maps workflow-id and version to the set of fields |
| 266 |
// that are managed by that workflow. This is mostly for internal |
| 267 |
// housekeeping, and users typically shouldn't need to set or |
| 268 |
// understand this field. A workflow can be the user's name, a |
| 269 |
// controller's name, or the name of a specific apply path like |
| 270 |
// "ci-cd". The set of fields is always in the version that the |
| 271 |
// workflow used when modifying the object. |
| 272 |
// |
| 273 |
// +optional |
| 274 |
// +listType=atomic |
| 275 |
ManagedFields []ManagedFieldsEntry `json:"managedFields,omitempty" protobuf:"bytes,17,rep,name=managedFields"` |
| 276 |
} |
| 277 |
|
| 278 |
const ( |
| 279 |
// NamespaceDefault means the object is in the default namespace which is applied when not specified by clients |
| 280 |
NamespaceDefault = "default" |
| 281 |
// NamespaceAll is the default argument to specify on a context when you want to list or filter resources across all namespaces |
| 282 |
NamespaceAll = "" |
| 283 |
// NamespaceNone is the argument for a context when there is no namespace. |
| 284 |
NamespaceNone = "" |
| 285 |
// NamespaceSystem is the system namespace where we place system components. |
| 286 |
NamespaceSystem = "kube-system" |
| 287 |
// NamespacePublic is the namespace where we place public info (ConfigMaps) |
| 288 |
NamespacePublic = "kube-public" |
| 289 |
) |
| 290 |
|
| 291 |
// OwnerReference contains enough information to let you identify an owning |
| 292 |
// object. An owning object must be in the same namespace as the dependent, or |
| 293 |
// be cluster-scoped, so there is no namespace field. |
| 294 |
// +structType=atomic |
| 295 |
type OwnerReference struct { |
| 296 |
// API version of the referent. |
| 297 |
APIVersion string `json:"apiVersion" protobuf:"bytes,5,opt,name=apiVersion"` |
| 298 |
// Kind of the referent. |
| 299 |
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds |
| 300 |
Kind string `json:"kind" protobuf:"bytes,1,opt,name=kind"` |
| 301 |
// Name of the referent. |
| 302 |
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names |
| 303 |
Name string `json:"name" protobuf:"bytes,3,opt,name=name"` |
| 304 |
// UID of the referent. |
| 305 |
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids |
| 306 |
UID types.UID `json:"uid" protobuf:"bytes,4,opt,name=uid,casttype=k8s.io/apimachinery/pkg/types.UID"` |
| 307 |
// If true, this reference points to the managing controller. |
| 308 |
// +optional |
| 309 |
Controller *bool `json:"controller,omitempty" protobuf:"varint,6,opt,name=controller"` |
| 310 |
// If true, AND if the owner has the "foregroundDeletion" finalizer, then |
| 311 |
// the owner cannot be deleted from the key-value store until this |
| 312 |
// reference is removed. |
| 313 |
// See https://kubernetes.io/docs/concepts/architecture/garbage-collection/#foreground-deletion |
| 314 |
// for how the garbage collector interacts with this field and enforces the foreground deletion. |
| 315 |
// Defaults to false. |
| 316 |
// To set this field, a user needs "delete" permission of the owner, |
| 317 |
// otherwise 422 (Unprocessable Entity) will be returned. |
| 318 |
// +optional |
| 319 |
BlockOwnerDeletion *bool `json:"blockOwnerDeletion,omitempty" protobuf:"varint,7,opt,name=blockOwnerDeletion"` |
| 320 |
} |
| 321 |
|
| 322 |
// +k8s:conversion-gen:explicit-from=net/url.Values |
| 323 |
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 324 |
|
| 325 |
// ListOptions is the query options to a standard REST list call. |
| 326 |
type ListOptions struct { |
| 327 |
TypeMeta `json:",inline"` |
| 328 |
|
| 329 |
// A selector to restrict the list of returned objects by their labels. |
| 330 |
// Defaults to everything. |
| 331 |
// +optional |
| 332 |
LabelSelector string `json:"labelSelector,omitempty" protobuf:"bytes,1,opt,name=labelSelector"` |
| 333 |
// A selector to restrict the list of returned objects by their fields. |
| 334 |
// Defaults to everything. |
| 335 |
// +optional |
| 336 |
FieldSelector string `json:"fieldSelector,omitempty" protobuf:"bytes,2,opt,name=fieldSelector"` |
| 337 |
|
| 338 |
// +k8s:deprecated=includeUninitialized,protobuf=6 |
| 339 |
|
| 340 |
// Watch for changes to the described resources and return them as a stream of |
| 341 |
// add, update, and remove notifications. Specify resourceVersion. |
| 342 |
// +optional |
| 343 |
Watch bool `json:"watch,omitempty" protobuf:"varint,3,opt,name=watch"` |
| 344 |
// allowWatchBookmarks requests watch events with type "BOOKMARK". |
| 345 |
// Servers that do not implement bookmarks may ignore this flag and |
| 346 |
// bookmarks are sent at the server's discretion. Clients should not |
| 347 |
// assume bookmarks are returned at any specific interval, nor may they |
| 348 |
// assume the server will send any BOOKMARK event during a session. |
| 349 |
// If this is not a watch, this field is ignored. |
| 350 |
// +optional |
| 351 |
AllowWatchBookmarks bool `json:"allowWatchBookmarks,omitempty" protobuf:"varint,9,opt,name=allowWatchBookmarks"` |
| 352 |
|
| 353 |
// resourceVersion sets a constraint on what resource versions a request may be served from. |
| 354 |
// See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for |
| 355 |
// details. |
| 356 |
// |
| 357 |
// Defaults to unset |
| 358 |
// +optional |
| 359 |
ResourceVersion string `json:"resourceVersion,omitempty" protobuf:"bytes,4,opt,name=resourceVersion"` |
| 360 |
|
| 361 |
// resourceVersionMatch determines how resourceVersion is applied to list calls. |
| 362 |
// It is highly recommended that resourceVersionMatch be set for list calls where |
| 363 |
// resourceVersion is set |
| 364 |
// See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for |
| 365 |
// details. |
| 366 |
// |
| 367 |
// Defaults to unset |
| 368 |
// +optional |
| 369 |
ResourceVersionMatch ResourceVersionMatch `json:"resourceVersionMatch,omitempty" protobuf:"bytes,10,opt,name=resourceVersionMatch,casttype=ResourceVersionMatch"` |
| 370 |
// Timeout for the list/watch call. |
| 371 |
// This limits the duration of the call, regardless of any activity or inactivity. |
| 372 |
// +optional |
| 373 |
TimeoutSeconds *int64 `json:"timeoutSeconds,omitempty" protobuf:"varint,5,opt,name=timeoutSeconds"` |
| 374 |
|
| 375 |
// limit is a maximum number of responses to return for a list call. If more items exist, the |
| 376 |
// server will set the `continue` field on the list metadata to a value that can be used with the |
| 377 |
// same initial query to retrieve the next set of results. Setting a limit may return fewer than |
| 378 |
// the requested amount of items (up to zero items) in the event all requested objects are |
| 379 |
// filtered out and clients should only use the presence of the continue field to determine whether |
| 380 |
// more results are available. Servers may choose not to support the limit argument and will return |
| 381 |
// all of the available results. If limit is specified and the continue field is empty, clients may |
| 382 |
// assume that no more results are available. This field is not supported if watch is true. |
| 383 |
// |
| 384 |
// The server guarantees that the objects returned when using continue will be identical to issuing |
| 385 |
// a single list call without a limit - that is, no objects created, modified, or deleted after the |
| 386 |
// first request is issued will be included in any subsequent continued requests. This is sometimes |
| 387 |
// referred to as a consistent snapshot, and ensures that a client that is using limit to receive |
| 388 |
// smaller chunks of a very large result can ensure they see all possible objects. If objects are |
| 389 |
// updated during a chunked list the version of the object that was present at the time the first list |
| 390 |
// result was calculated is returned. |
| 391 |
Limit int64 `json:"limit,omitempty" protobuf:"varint,7,opt,name=limit"` |
| 392 |
// The continue option should be set when retrieving more results from the server. Since this value is |
| 393 |
// server defined, clients may only use the continue value from a previous query result with identical |
| 394 |
// query parameters (except for the value of continue) and the server may reject a continue value it |
| 395 |
// does not recognize. If the specified continue value is no longer valid whether due to expiration |
| 396 |
// (generally five to fifteen minutes) or a configuration change on the server, the server will |
| 397 |
// respond with a 410 ResourceExpired error together with a continue token. If the client needs a |
| 398 |
// consistent list, it must restart their list without the continue field. Otherwise, the client may |
| 399 |
// send another list request with the token received with the 410 error, the server will respond with |
| 400 |
// a list starting from the next key, but from the latest snapshot, which is inconsistent from the |
| 401 |
// previous list results - objects that are created, modified, or deleted after the first list request |
| 402 |
// will be included in the response, as long as their keys are after the "next key". |
| 403 |
// |
| 404 |
// This field is not supported when watch is true. Clients may start a watch from the last |
| 405 |
// resourceVersion value returned by the server and not miss any modifications. |
| 406 |
Continue string `json:"continue,omitempty" protobuf:"bytes,8,opt,name=continue"` |
| 407 |
|
| 408 |
// `sendInitialEvents=true` may be set together with `watch=true`. |
| 409 |
// In that case, the watch stream will begin with synthetic events to |
| 410 |
// produce the current state of objects in the collection. Once all such |
| 411 |
// events have been sent, a synthetic "Bookmark" event will be sent. |
| 412 |
// The bookmark will report the ResourceVersion (RV) corresponding to the |
| 413 |
// set of objects, and be marked with `"k8s.io/initial-events-end": "true"` annotation. |
| 414 |
// Afterwards, the watch stream will proceed as usual, sending watch events |
| 415 |
// corresponding to changes (subsequent to the RV) to objects watched. |
| 416 |
// |
| 417 |
// When `sendInitialEvents` option is set, we require `resourceVersionMatch` |
| 418 |
// option to also be set. The semantic of the watch request is as following: |
| 419 |
// - `resourceVersionMatch` = NotOlderThan |
| 420 |
// is interpreted as "data at least as new as the provided `resourceVersion`" |
| 421 |
// and the bookmark event is send when the state is synced |
| 422 |
// to a `resourceVersion` at least as fresh as the one provided by the ListOptions. |
| 423 |
// If `resourceVersion` is unset, this is interpreted as "consistent read" and the |
| 424 |
// bookmark event is send when the state is synced at least to the moment |
| 425 |
// when request started being processed. |
| 426 |
// - `resourceVersionMatch` set to any other value or unset |
| 427 |
// Invalid error is returned. |
| 428 |
// |
| 429 |
// Defaults to true if `resourceVersion=""` or `resourceVersion="0"` (for backward |
| 430 |
// compatibility reasons) and to false otherwise. |
| 431 |
// +optional |
| 432 |
SendInitialEvents *bool `json:"sendInitialEvents,omitempty" protobuf:"varint,11,opt,name=sendInitialEvents"` |
| 433 |
} |
| 434 |
|
| 435 |
const ( |
| 436 |
// InitialEventsAnnotationKey the name of the key |
| 437 |
// under which an annotation marking the end of |
| 438 |
// a watchlist stream is stored. |
| 439 |
// |
| 440 |
// The annotation is added to a "Bookmark" event. |
| 441 |
InitialEventsAnnotationKey = "k8s.io/initial-events-end" |
| 442 |
|
| 443 |
// InitialEventsListBlueprintAnnotationKey is the name of the key |
| 444 |
// where an empty, versioned list is encoded in the requested format |
| 445 |
// (e.g., protobuf, JSON, CBOR), then base64-encoded and stored as a string. |
| 446 |
// |
| 447 |
// This encoding matches the request encoding format, which may be |
| 448 |
// protobuf, JSON, CBOR, or others, depending on what the client requested. |
| 449 |
// This ensures that the reconstructed list can be processed through the |
| 450 |
// same decoder chain that would handle a standard LIST call response. |
| 451 |
// |
| 452 |
// The annotation is added to a "Bookmark" event and is used by clients |
| 453 |
// to guarantee the format consistency when reconstructing |
| 454 |
// the list during WatchList processing. |
| 455 |
InitialEventsListBlueprintAnnotationKey = "kubernetes.io/initial-events-list-blueprint" |
| 456 |
) |
| 457 |
|
| 458 |
// resourceVersionMatch specifies how the resourceVersion parameter is applied. resourceVersionMatch |
| 459 |
// may only be set if resourceVersion is also set. |
| 460 |
// |
| 461 |
// "NotOlderThan" matches data at least as new as the provided resourceVersion. |
| 462 |
// "Exact" matches data at the exact resourceVersion provided. |
| 463 |
// |
| 464 |
// See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for |
| 465 |
// details. |
| 466 |
type ResourceVersionMatch string |
| 467 |
|
| 468 |
const ( |
| 469 |
// ResourceVersionMatchNotOlderThan matches data at least as new as the provided |
| 470 |
// resourceVersion. |
| 471 |
ResourceVersionMatchNotOlderThan ResourceVersionMatch = "NotOlderThan" |
| 472 |
// ResourceVersionMatchExact matches data at the exact resourceVersion |
| 473 |
// provided. |
| 474 |
ResourceVersionMatchExact ResourceVersionMatch = "Exact" |
| 475 |
) |
| 476 |
|
| 477 |
// +k8s:conversion-gen:explicit-from=net/url.Values |
| 478 |
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 479 |
|
| 480 |
// GetOptions is the standard query options to the standard REST get call. |
| 481 |
type GetOptions struct { |
| 482 |
TypeMeta `json:",inline"` |
| 483 |
// resourceVersion sets a constraint on what resource versions a request may be served from. |
| 484 |
// See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for |
| 485 |
// details. |
| 486 |
// |
| 487 |
// Defaults to unset |
| 488 |
// +optional |
| 489 |
ResourceVersion string `json:"resourceVersion,omitempty" protobuf:"bytes,1,opt,name=resourceVersion"` |
| 490 |
// +k8s:deprecated=includeUninitialized,protobuf=2 |
| 491 |
} |
| 492 |
|
| 493 |
// DeletionPropagation decides if a deletion will propagate to the dependents of |
| 494 |
// the object, and how the garbage collector will handle the propagation. |
| 495 |
type DeletionPropagation string |
| 496 |
|
| 497 |
const ( |
| 498 |
// Orphans the dependents. |
| 499 |
DeletePropagationOrphan DeletionPropagation = "Orphan" |
| 500 |
// Deletes the object from the key-value store, the garbage collector will |
| 501 |
// delete the dependents in the background. |
| 502 |
DeletePropagationBackground DeletionPropagation = "Background" |
| 503 |
// The object exists in the key-value store until the garbage collector |
| 504 |
// deletes all the dependents whose ownerReference.blockOwnerDeletion=true |
| 505 |
// from the key-value store. API sever will put the "foregroundDeletion" |
| 506 |
// finalizer on the object, and sets its deletionTimestamp. This policy is |
| 507 |
// cascading, i.e., the dependents will be deleted with Foreground. |
| 508 |
DeletePropagationForeground DeletionPropagation = "Foreground" |
| 509 |
) |
| 510 |
|
| 511 |
const ( |
| 512 |
// DryRunAll means to complete all processing stages, but don't |
| 513 |
// persist changes to storage. |
| 514 |
DryRunAll = "All" |
| 515 |
) |
| 516 |
|
| 517 |
// +k8s:conversion-gen:explicit-from=net/url.Values |
| 518 |
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 519 |
|
| 520 |
// DeleteOptions may be provided when deleting an API object. |
| 521 |
type DeleteOptions struct { |
| 522 |
TypeMeta `json:",inline"` |
| 523 |
|
| 524 |
// The duration in seconds before the object should be deleted. Value must be non-negative integer. |
| 525 |
// The value zero indicates delete immediately. If this value is nil, the default grace period for the |
| 526 |
// specified type will be used. |
| 527 |
// Defaults to a per object value if not specified. zero means delete immediately. |
| 528 |
// +optional |
| 529 |
GracePeriodSeconds *int64 `json:"gracePeriodSeconds,omitempty" protobuf:"varint,1,opt,name=gracePeriodSeconds"` |
| 530 |
|
| 531 |
// Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be |
| 532 |
// returned. |
| 533 |
// +k8s:conversion-gen=false |
| 534 |
// +optional |
| 535 |
Preconditions *Preconditions `json:"preconditions,omitempty" protobuf:"bytes,2,opt,name=preconditions"` |
| 536 |
|
| 537 |
// Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. |
| 538 |
// Should the dependent objects be orphaned. If true/false, the "orphan" |
| 539 |
// finalizer will be added to/removed from the object's finalizers list. |
| 540 |
// Either this field or PropagationPolicy may be set, but not both. |
| 541 |
// +optional |
| 542 |
OrphanDependents *bool `json:"orphanDependents,omitempty" protobuf:"varint,3,opt,name=orphanDependents"` |
| 543 |
|
| 544 |
// Whether and how garbage collection will be performed. |
| 545 |
// Either this field or OrphanDependents may be set, but not both. |
| 546 |
// The default policy is decided by the existing finalizer set in the |
| 547 |
// metadata.finalizers and the resource-specific default policy. |
| 548 |
// Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - |
| 549 |
// allow the garbage collector to delete the dependents in the background; |
| 550 |
// 'Foreground' - a cascading policy that deletes all dependents in the |
| 551 |
// foreground. |
| 552 |
// +optional |
| 553 |
PropagationPolicy *DeletionPropagation `json:"propagationPolicy,omitempty" protobuf:"varint,4,opt,name=propagationPolicy"` |
| 554 |
|
| 555 |
// When present, indicates that modifications should not be |
| 556 |
// persisted. An invalid or unrecognized dryRun directive will |
| 557 |
// result in an error response and no further processing of the |
| 558 |
// request. Valid values are: |
| 559 |
// - All: all dry run stages will be processed |
| 560 |
// +optional |
| 561 |
// +listType=atomic |
| 562 |
DryRun []string `json:"dryRun,omitempty" protobuf:"bytes,5,rep,name=dryRun"` |
| 563 |
|
| 564 |
// if set to true, it will trigger an unsafe deletion of the resource in |
| 565 |
// case the normal deletion flow fails with a corrupt object error. |
| 566 |
// A resource is considered corrupt if it can not be retrieved from |
| 567 |
// the underlying storage successfully because of a) its data can |
| 568 |
// not be transformed e.g. decryption failure, or b) it fails |
| 569 |
// to decode into an object. |
| 570 |
// NOTE: unsafe deletion ignores finalizer constraints, skips |
| 571 |
// precondition checks, and removes the object from the storage. |
| 572 |
// WARNING: This may potentially break the cluster if the workload |
| 573 |
// associated with the resource being unsafe-deleted relies on normal |
| 574 |
// deletion flow. Use only if you REALLY know what you are doing. |
| 575 |
// The default value is false, and the user must opt in to enable it |
| 576 |
// +optional |
| 577 |
IgnoreStoreReadErrorWithClusterBreakingPotential *bool `json:"ignoreStoreReadErrorWithClusterBreakingPotential,omitempty" protobuf:"varint,6,opt,name=ignoreStoreReadErrorWithClusterBreakingPotential"` |
| 578 |
} |
| 579 |
|
| 580 |
const ( |
| 581 |
// FieldValidationIgnore ignores unknown/duplicate fields |
| 582 |
FieldValidationIgnore = "Ignore" |
| 583 |
// FieldValidationWarn responds with a warning, but successfully serve the request |
| 584 |
FieldValidationWarn = "Warn" |
| 585 |
// FieldValidationStrict fails the request on unknown/duplicate fields |
| 586 |
FieldValidationStrict = "Strict" |
| 587 |
) |
| 588 |
|
| 589 |
// +k8s:conversion-gen:explicit-from=net/url.Values |
| 590 |
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 591 |
|
| 592 |
// CreateOptions may be provided when creating an API object. |
| 593 |
type CreateOptions struct { |
| 594 |
TypeMeta `json:",inline"` |
| 595 |
|
| 596 |
// When present, indicates that modifications should not be |
| 597 |
// persisted. An invalid or unrecognized dryRun directive will |
| 598 |
// result in an error response and no further processing of the |
| 599 |
// request. Valid values are: |
| 600 |
// - All: all dry run stages will be processed |
| 601 |
// +optional |
| 602 |
// +listType=atomic |
| 603 |
DryRun []string `json:"dryRun,omitempty" protobuf:"bytes,1,rep,name=dryRun"` |
| 604 |
// +k8s:deprecated=includeUninitialized,protobuf=2 |
| 605 |
|
| 606 |
// fieldManager is a name associated with the actor or entity |
| 607 |
// that is making these changes. The value must be less than or |
| 608 |
// 128 characters long, and only contain printable characters, |
| 609 |
// as defined by https://golang.org/pkg/unicode/#IsPrint. |
| 610 |
// +optional |
| 611 |
FieldManager string `json:"fieldManager,omitempty" protobuf:"bytes,3,name=fieldManager"` |
| 612 |
|
| 613 |
// fieldValidation instructs the server on how to handle |
| 614 |
// objects in the request (POST/PUT/PATCH) containing unknown |
| 615 |
// or duplicate fields. Valid values are: |
| 616 |
// - Ignore: This will ignore any unknown fields that are silently |
| 617 |
// dropped from the object, and will ignore all but the last duplicate |
| 618 |
// field that the decoder encounters. This is the default behavior |
| 619 |
// prior to v1.23. |
| 620 |
// - Warn: This will send a warning via the standard warning response |
| 621 |
// header for each unknown field that is dropped from the object, and |
| 622 |
// for each duplicate field that is encountered. The request will |
| 623 |
// still succeed if there are no other errors, and will only persist |
| 624 |
// the last of any duplicate fields. This is the default in v1.23+ |
| 625 |
// - Strict: This will fail the request with a BadRequest error if |
| 626 |
// any unknown fields would be dropped from the object, or if any |
| 627 |
// duplicate fields are present. The error returned from the server |
| 628 |
// will contain all unknown and duplicate fields encountered. |
| 629 |
// +optional |
| 630 |
FieldValidation string `json:"fieldValidation,omitempty" protobuf:"bytes,4,name=fieldValidation"` |
| 631 |
} |
| 632 |
|
| 633 |
// +k8s:conversion-gen:explicit-from=net/url.Values |
| 634 |
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 635 |
|
| 636 |
// PatchOptions may be provided when patching an API object. |
| 637 |
// PatchOptions is meant to be a superset of UpdateOptions. |
| 638 |
type PatchOptions struct { |
| 639 |
TypeMeta `json:",inline"` |
| 640 |
|
| 641 |
// When present, indicates that modifications should not be |
| 642 |
// persisted. An invalid or unrecognized dryRun directive will |
| 643 |
// result in an error response and no further processing of the |
| 644 |
// request. Valid values are: |
| 645 |
// - All: all dry run stages will be processed |
| 646 |
// +optional |
| 647 |
// +listType=atomic |
| 648 |
DryRun []string `json:"dryRun,omitempty" protobuf:"bytes,1,rep,name=dryRun"` |
| 649 |
|
| 650 |
// Force is going to "force" Apply requests. It means user will |
| 651 |
// re-acquire conflicting fields owned by other people. Force |
| 652 |
// flag must be unset for non-apply patch requests. |
| 653 |
// +optional |
| 654 |
Force *bool `json:"force,omitempty" protobuf:"varint,2,opt,name=force"` |
| 655 |
|
| 656 |
// fieldManager is a name associated with the actor or entity |
| 657 |
// that is making these changes. The value must be less than or |
| 658 |
// 128 characters long, and only contain printable characters, |
| 659 |
// as defined by https://golang.org/pkg/unicode/#IsPrint. This |
| 660 |
// field is required for apply requests |
| 661 |
// (application/apply-patch) but optional for non-apply patch |
| 662 |
// types (JsonPatch, MergePatch, StrategicMergePatch). |
| 663 |
// +optional |
| 664 |
FieldManager string `json:"fieldManager,omitempty" protobuf:"bytes,3,name=fieldManager"` |
| 665 |
|
| 666 |
// fieldValidation instructs the server on how to handle |
| 667 |
// objects in the request (POST/PUT/PATCH) containing unknown |
| 668 |
// or duplicate fields. Valid values are: |
| 669 |
// - Ignore: This will ignore any unknown fields that are silently |
| 670 |
// dropped from the object, and will ignore all but the last duplicate |
| 671 |
// field that the decoder encounters. This is the default behavior |
| 672 |
// prior to v1.23. |
| 673 |
// - Warn: This will send a warning via the standard warning response |
| 674 |
// header for each unknown field that is dropped from the object, and |
| 675 |
// for each duplicate field that is encountered. The request will |
| 676 |
// still succeed if there are no other errors, and will only persist |
| 677 |
// the last of any duplicate fields. This is the default in v1.23+ |
| 678 |
// - Strict: This will fail the request with a BadRequest error if |
| 679 |
// any unknown fields would be dropped from the object, or if any |
| 680 |
// duplicate fields are present. The error returned from the server |
| 681 |
// will contain all unknown and duplicate fields encountered. |
| 682 |
// +optional |
| 683 |
FieldValidation string `json:"fieldValidation,omitempty" protobuf:"bytes,4,name=fieldValidation"` |
| 684 |
} |
| 685 |
|
| 686 |
// ApplyOptions may be provided when applying an API object. |
| 687 |
// FieldManager is required for apply requests. |
| 688 |
// ApplyOptions is equivalent to PatchOptions. It is provided as a convenience with documentation |
| 689 |
// that speaks specifically to how the options fields relate to apply. |
| 690 |
type ApplyOptions struct { |
| 691 |
TypeMeta `json:",inline"` |
| 692 |
|
| 693 |
// When present, indicates that modifications should not be |
| 694 |
// persisted. An invalid or unrecognized dryRun directive will |
| 695 |
// result in an error response and no further processing of the |
| 696 |
// request. Valid values are: |
| 697 |
// - All: all dry run stages will be processed |
| 698 |
// +optional |
| 699 |
// +listType=atomic |
| 700 |
DryRun []string `json:"dryRun,omitempty" protobuf:"bytes,1,rep,name=dryRun"` |
| 701 |
|
| 702 |
// Force is going to "force" Apply requests. It means user will |
| 703 |
// re-acquire conflicting fields owned by other people. |
| 704 |
Force bool `json:"force" protobuf:"varint,2,opt,name=force"` |
| 705 |
|
| 706 |
// fieldManager is a name associated with the actor or entity |
| 707 |
// that is making these changes. The value must be less than or |
| 708 |
// 128 characters long, and only contain printable characters, |
| 709 |
// as defined by https://golang.org/pkg/unicode/#IsPrint. This |
| 710 |
// field is required. |
| 711 |
FieldManager string `json:"fieldManager" protobuf:"bytes,3,name=fieldManager"` |
| 712 |
} |
| 713 |
|
| 714 |
func (o ApplyOptions) ToPatchOptions() PatchOptions { |
| 715 |
return PatchOptions{DryRun: o.DryRun, Force: &o.Force, FieldManager: o.FieldManager} |
| 716 |
} |
| 717 |
|
| 718 |
// +k8s:conversion-gen:explicit-from=net/url.Values |
| 719 |
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 720 |
|
| 721 |
// UpdateOptions may be provided when updating an API object. |
| 722 |
// All fields in UpdateOptions should also be present in PatchOptions. |
| 723 |
type UpdateOptions struct { |
| 724 |
TypeMeta `json:",inline"` |
| 725 |
|
| 726 |
// When present, indicates that modifications should not be |
| 727 |
// persisted. An invalid or unrecognized dryRun directive will |
| 728 |
// result in an error response and no further processing of the |
| 729 |
// request. Valid values are: |
| 730 |
// - All: all dry run stages will be processed |
| 731 |
// +optional |
| 732 |
// +listType=atomic |
| 733 |
DryRun []string `json:"dryRun,omitempty" protobuf:"bytes,1,rep,name=dryRun"` |
| 734 |
|
| 735 |
// fieldManager is a name associated with the actor or entity |
| 736 |
// that is making these changes. The value must be less than or |
| 737 |
// 128 characters long, and only contain printable characters, |
| 738 |
// as defined by https://golang.org/pkg/unicode/#IsPrint. |
| 739 |
// +optional |
| 740 |
FieldManager string `json:"fieldManager,omitempty" protobuf:"bytes,2,name=fieldManager"` |
| 741 |
|
| 742 |
// fieldValidation instructs the server on how to handle |
| 743 |
// objects in the request (POST/PUT/PATCH) containing unknown |
| 744 |
// or duplicate fields. Valid values are: |
| 745 |
// - Ignore: This will ignore any unknown fields that are silently |
| 746 |
// dropped from the object, and will ignore all but the last duplicate |
| 747 |
// field that the decoder encounters. This is the default behavior |
| 748 |
// prior to v1.23. |
| 749 |
// - Warn: This will send a warning via the standard warning response |
| 750 |
// header for each unknown field that is dropped from the object, and |
| 751 |
// for each duplicate field that is encountered. The request will |
| 752 |
// still succeed if there are no other errors, and will only persist |
| 753 |
// the last of any duplicate fields. This is the default in v1.23+ |
| 754 |
// - Strict: This will fail the request with a BadRequest error if |
| 755 |
// any unknown fields would be dropped from the object, or if any |
| 756 |
// duplicate fields are present. The error returned from the server |
| 757 |
// will contain all unknown and duplicate fields encountered. |
| 758 |
// +optional |
| 759 |
FieldValidation string `json:"fieldValidation,omitempty" protobuf:"bytes,3,name=fieldValidation"` |
| 760 |
} |
| 761 |
|
| 762 |
// Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out. |
| 763 |
type Preconditions struct { |
| 764 |
// Specifies the target UID. |
| 765 |
// +optional |
| 766 |
UID *types.UID `json:"uid,omitempty" protobuf:"bytes,1,opt,name=uid,casttype=k8s.io/apimachinery/pkg/types.UID"` |
| 767 |
// Specifies the target ResourceVersion |
| 768 |
// +optional |
| 769 |
ResourceVersion *string `json:"resourceVersion,omitempty" protobuf:"bytes,2,opt,name=resourceVersion"` |
| 770 |
} |
| 771 |
|
| 772 |
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 773 |
|
| 774 |
// Status is a return value for calls that don't return other objects. |
| 775 |
type Status struct { |
| 776 |
TypeMeta `json:",inline"` |
| 777 |
// Standard list metadata. |
| 778 |
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds |
| 779 |
// +optional |
| 780 |
ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` |
| 781 |
|
| 782 |
// Status of the operation. |
| 783 |
// One of: "Success" or "Failure". |
| 784 |
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status |
| 785 |
// +optional |
| 786 |
Status string `json:"status,omitempty" protobuf:"bytes,2,opt,name=status"` |
| 787 |
// A human-readable description of the status of this operation. |
| 788 |
// +optional |
| 789 |
Message string `json:"message,omitempty" protobuf:"bytes,3,opt,name=message"` |
| 790 |
// A machine-readable description of why this operation is in the |
| 791 |
// "Failure" status. If this value is empty there |
| 792 |
// is no information available. A Reason clarifies an HTTP status |
| 793 |
// code but does not override it. |
| 794 |
// +optional |
| 795 |
Reason StatusReason `json:"reason,omitempty" protobuf:"bytes,4,opt,name=reason,casttype=StatusReason"` |
| 796 |
// Extended data associated with the reason. Each reason may define its |
| 797 |
// own extended details. This field is optional and the data returned |
| 798 |
// is not guaranteed to conform to any schema except that defined by |
| 799 |
// the reason type. |
| 800 |
// +optional |
| 801 |
// +listType=atomic |
| 802 |
Details *StatusDetails `json:"details,omitempty" protobuf:"bytes,5,opt,name=details"` |
| 803 |
// Suggested HTTP return code for this status, 0 if not set. |
| 804 |
// +optional |
| 805 |
Code int32 `json:"code,omitempty" protobuf:"varint,6,opt,name=code"` |
| 806 |
} |
| 807 |
|
| 808 |
// StatusDetails is a set of additional properties that MAY be set by the |
| 809 |
// server to provide additional information about a response. The Reason |
| 810 |
// field of a Status object defines what attributes will be set. Clients |
| 811 |
// must ignore fields that do not match the defined type of each attribute, |
| 812 |
// and should assume that any attribute may be empty, invalid, or under |
| 813 |
// defined. |
| 814 |
type StatusDetails struct { |
| 815 |
// The name attribute of the resource associated with the status StatusReason |
| 816 |
// (when there is a single name which can be described). |
| 817 |
// +optional |
| 818 |
Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"` |
| 819 |
// The group attribute of the resource associated with the status StatusReason. |
| 820 |
// +optional |
| 821 |
Group string `json:"group,omitempty" protobuf:"bytes,2,opt,name=group"` |
| 822 |
// The kind attribute of the resource associated with the status StatusReason. |
| 823 |
// On some operations may differ from the requested resource Kind. |
| 824 |
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds |
| 825 |
// +optional |
| 826 |
Kind string `json:"kind,omitempty" protobuf:"bytes,3,opt,name=kind"` |
| 827 |
// UID of the resource. |
| 828 |
// (when there is a single resource which can be described). |
| 829 |
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids |
| 830 |
// +optional |
| 831 |
UID types.UID `json:"uid,omitempty" protobuf:"bytes,6,opt,name=uid,casttype=k8s.io/apimachinery/pkg/types.UID"` |
| 832 |
// The Causes array includes more details associated with the StatusReason |
| 833 |
// failure. Not all StatusReasons may provide detailed causes. |
| 834 |
// +optional |
| 835 |
// +listType=atomic |
| 836 |
Causes []StatusCause `json:"causes,omitempty" protobuf:"bytes,4,rep,name=causes"` |
| 837 |
// If specified, the time in seconds before the operation should be retried. Some errors may indicate |
| 838 |
// the client must take an alternate action - for those errors this field may indicate how long to wait |
| 839 |
// before taking the alternate action. |
| 840 |
// +optional |
| 841 |
RetryAfterSeconds int32 `json:"retryAfterSeconds,omitempty" protobuf:"varint,5,opt,name=retryAfterSeconds"` |
| 842 |
} |
| 843 |
|
| 844 |
// Values of Status.Status |
| 845 |
const ( |
| 846 |
StatusSuccess = "Success" |
| 847 |
StatusFailure = "Failure" |
| 848 |
) |
| 849 |
|
| 850 |
// StatusReason is an enumeration of possible failure causes. Each StatusReason |
| 851 |
// must map to a single HTTP status code, but multiple reasons may map |
| 852 |
// to the same HTTP status code. |
| 853 |
// TODO: move to apiserver |
| 854 |
type StatusReason string |
| 855 |
|
| 856 |
const ( |
| 857 |
// StatusReasonUnknown means the server has declined to indicate a specific reason. |
| 858 |
// The details field may contain other information about this error. |
| 859 |
// Status code 500. |
| 860 |
StatusReasonUnknown StatusReason = "" |
| 861 |
|
| 862 |
// StatusReasonUnauthorized means the server can be reached and understood the request, but requires |
| 863 |
// the user to present appropriate authorization credentials (identified by the WWW-Authenticate header) |
| 864 |
// in order for the action to be completed. If the user has specified credentials on the request, the |
| 865 |
// server considers them insufficient. |
| 866 |
// Status code 401 |
| 867 |
StatusReasonUnauthorized StatusReason = "Unauthorized" |
| 868 |
|
| 869 |
// StatusReasonForbidden means the server can be reached and understood the request, but refuses |
| 870 |
// to take any further action. It is the result of the server being configured to deny access for some reason |
| 871 |
// to the requested resource by the client. |
| 872 |
// Details (optional): |
| 873 |
// "kind" string - the kind attribute of the forbidden resource |
| 874 |
// on some operations may differ from the requested |
| 875 |
// resource. |
| 876 |
// "id" string - the identifier of the forbidden resource |
| 877 |
// Status code 403 |
| 878 |
StatusReasonForbidden StatusReason = "Forbidden" |
| 879 |
|
| 880 |
// StatusReasonNotFound means one or more resources required for this operation |
| 881 |
// could not be found. |
| 882 |
// Details (optional): |
| 883 |
// "kind" string - the kind attribute of the missing resource |
| 884 |
// on some operations may differ from the requested |
| 885 |
// resource. |
| 886 |
// "id" string - the identifier of the missing resource |
| 887 |
// Status code 404 |
| 888 |
StatusReasonNotFound StatusReason = "NotFound" |
| 889 |
|
| 890 |
// StatusReasonAlreadyExists means the resource you are creating already exists. |
| 891 |
// Details (optional): |
| 892 |
// "kind" string - the kind attribute of the conflicting resource |
| 893 |
// "id" string - the identifier of the conflicting resource |
| 894 |
// Status code 409 |
| 895 |
StatusReasonAlreadyExists StatusReason = "AlreadyExists" |
| 896 |
|
| 897 |
// StatusReasonConflict means the requested operation cannot be completed |
| 898 |
// due to a conflict in the operation. The client may need to alter the |
| 899 |
// request. Each resource may define custom details that indicate the |
| 900 |
// nature of the conflict. |
| 901 |
// Status code 409 |
| 902 |
StatusReasonConflict StatusReason = "Conflict" |
| 903 |
|
| 904 |
// StatusReasonGone means the item is no longer available at the server and no |
| 905 |
// forwarding address is known. |
| 906 |
// Status code 410 |
| 907 |
StatusReasonGone StatusReason = "Gone" |
| 908 |
|
| 909 |
// StatusReasonInvalid means the requested create or update operation cannot be |
| 910 |
// completed due to invalid data provided as part of the request. The client may |
| 911 |
// need to alter the request. When set, the client may use the StatusDetails |
| 912 |
// message field as a summary of the issues encountered. |
| 913 |
// Details (optional): |
| 914 |
// "kind" string - the kind attribute of the invalid resource |
| 915 |
// "id" string - the identifier of the invalid resource |
| 916 |
// "causes" - one or more StatusCause entries indicating the data in the |
| 917 |
// provided resource that was invalid. The code, message, and |
| 918 |
// field attributes will be set. |
| 919 |
// Status code 422 |
| 920 |
StatusReasonInvalid StatusReason = "Invalid" |
| 921 |
|
| 922 |
// StatusReasonServerTimeout means the server can be reached and understood the request, |
| 923 |
// but cannot complete the action in a reasonable time. The client should retry the request. |
| 924 |
// This is may be due to temporary server load or a transient communication issue with |
| 925 |
// another server. Status code 500 is used because the HTTP spec provides no suitable |
| 926 |
// server-requested client retry and the 5xx class represents actionable errors. |
| 927 |
// Details (optional): |
| 928 |
// "kind" string - the kind attribute of the resource being acted on. |
| 929 |
// "id" string - the operation that is being attempted. |
| 930 |
// "retryAfterSeconds" int32 - the number of seconds before the operation should be retried |
| 931 |
// Status code 500 |
| 932 |
StatusReasonServerTimeout StatusReason = "ServerTimeout" |
| 933 |
|
| 934 |
// StatusReasonStoreReadError means that the server encountered an error while |
| 935 |
// retrieving resources from the backend object store. |
| 936 |
// This may be due to backend database error, or because processing of the read |
| 937 |
// resource failed. |
| 938 |
// Details: |
| 939 |
// "kind" string - the kind attribute of the resource being acted on. |
| 940 |
// "name" string - the prefix where the reading error(s) occurred |
| 941 |
// "causes" []StatusCause |
| 942 |
// - (optional): |
| 943 |
// - "type" CauseType - CauseTypeUnexpectedServerResponse |
| 944 |
// - "message" string - the error message from the store backend |
| 945 |
// - "field" string - the full path with the key of the resource that failed reading |
| 946 |
// |
| 947 |
// Status code 500 |
| 948 |
StatusReasonStoreReadError StatusReason = "StorageReadError" |
| 949 |
|
| 950 |
// StatusReasonTimeout means that the request could not be completed within the given time. |
| 951 |
// Clients can get this response only when they specified a timeout param in the request, |
| 952 |
// or if the server cannot complete the operation within a reasonable amount of time. |
| 953 |
// The request might succeed with an increased value of timeout param. The client *should* |
| 954 |
// wait at least the number of seconds specified by the retryAfterSeconds field. |
| 955 |
// Details (optional): |
| 956 |
// "retryAfterSeconds" int32 - the number of seconds before the operation should be retried |
| 957 |
// Status code 504 |
| 958 |
StatusReasonTimeout StatusReason = "Timeout" |
| 959 |
|
| 960 |
// StatusReasonTooManyRequests means the server experienced too many requests within a |
| 961 |
// given window and that the client must wait to perform the action again. A client may |
| 962 |
// always retry the request that led to this error, although the client should wait at least |
| 963 |
// the number of seconds specified by the retryAfterSeconds field. |
| 964 |
// Details (optional): |
| 965 |
// "retryAfterSeconds" int32 - the number of seconds before the operation should be retried |
| 966 |
// Status code 429 |
| 967 |
StatusReasonTooManyRequests StatusReason = "TooManyRequests" |
| 968 |
|
| 969 |
// StatusReasonBadRequest means that the request itself was invalid, because the request |
| 970 |
// doesn't make any sense, for example deleting a read-only object. This is different than |
| 971 |
// StatusReasonInvalid above which indicates that the API call could possibly succeed, but the |
| 972 |
// data was invalid. API calls that return BadRequest can never succeed. |
| 973 |
// Status code 400 |
| 974 |
StatusReasonBadRequest StatusReason = "BadRequest" |
| 975 |
|
| 976 |
// StatusReasonMethodNotAllowed means that the action the client attempted to perform on the |
| 977 |
// resource was not supported by the code - for instance, attempting to delete a resource that |
| 978 |
// can only be created. API calls that return MethodNotAllowed can never succeed. |
| 979 |
// Status code 405 |
| 980 |
StatusReasonMethodNotAllowed StatusReason = "MethodNotAllowed" |
| 981 |
|
| 982 |
// StatusReasonNotAcceptable means that the accept types indicated by the client were not acceptable |
| 983 |
// to the server - for instance, attempting to receive protobuf for a resource that supports only json and yaml. |
| 984 |
// API calls that return NotAcceptable can never succeed. |
| 985 |
// Status code 406 |
| 986 |
StatusReasonNotAcceptable StatusReason = "NotAcceptable" |
| 987 |
|
| 988 |
// StatusReasonRequestEntityTooLarge means that the request entity is too large. |
| 989 |
// Status code 413 |
| 990 |
StatusReasonRequestEntityTooLarge StatusReason = "RequestEntityTooLarge" |
| 991 |
|
| 992 |
// StatusReasonUnsupportedMediaType means that the content type sent by the client is not acceptable |
| 993 |
// to the server - for instance, attempting to send protobuf for a resource that supports only json and yaml. |
| 994 |
// API calls that return UnsupportedMediaType can never succeed. |
| 995 |
// Status code 415 |
| 996 |
StatusReasonUnsupportedMediaType StatusReason = "UnsupportedMediaType" |
| 997 |
|
| 998 |
// StatusReasonInternalError indicates that an internal error occurred, it is unexpected |
| 999 |
// and the outcome of the call is unknown. |
| 1000 |
// Details (optional): |
| 1001 |
// "causes" - The original error |
| 1002 |
// Status code 500 |
| 1003 |
StatusReasonInternalError StatusReason = "InternalError" |
| 1004 |
|
| 1005 |
// StatusReasonExpired indicates that the request is invalid because the content you are requesting |
| 1006 |
// has expired and is no longer available. It is typically associated with watches that can't be |
| 1007 |
// serviced. |
| 1008 |
// Status code 410 (gone) |
| 1009 |
StatusReasonExpired StatusReason = "Expired" |
| 1010 |
|
| 1011 |
// StatusReasonServiceUnavailable means that the request itself was valid, |
| 1012 |
// but the requested service is unavailable at this time. |
| 1013 |
// Retrying the request after some time might succeed. |
| 1014 |
// Status code 503 |
| 1015 |
StatusReasonServiceUnavailable StatusReason = "ServiceUnavailable" |
| 1016 |
) |
| 1017 |
|
| 1018 |
// StatusCause provides more information about an api.Status failure, including |
| 1019 |
// cases when multiple errors are encountered. |
| 1020 |
type StatusCause struct { |
| 1021 |
// A machine-readable description of the cause of the error. If this value is |
| 1022 |
// empty there is no information available. |
| 1023 |
// +optional |
| 1024 |
Type CauseType `json:"reason,omitempty" protobuf:"bytes,1,opt,name=reason,casttype=CauseType"` |
| 1025 |
// A human-readable description of the cause of the error. This field may be |
| 1026 |
// presented as-is to a reader. |
| 1027 |
// +optional |
| 1028 |
Message string `json:"message,omitempty" protobuf:"bytes,2,opt,name=message"` |
| 1029 |
// The field of the resource that has caused this error, as named by its JSON |
| 1030 |
// serialization. May include dot and postfix notation for nested attributes. |
| 1031 |
// Arrays are zero-indexed. Fields may appear more than once in an array of |
| 1032 |
// causes due to fields having multiple errors. |
| 1033 |
// Optional. |
| 1034 |
// |
| 1035 |
// Examples: |
| 1036 |
// "name" - the field "name" on the current resource |
| 1037 |
// "items[0].name" - the field "name" on the first array entry in "items" |
| 1038 |
// +optional |
| 1039 |
Field string `json:"field,omitempty" protobuf:"bytes,3,opt,name=field"` |
| 1040 |
} |
| 1041 |
|
| 1042 |
// CauseType is a machine readable value providing more detail about what |
| 1043 |
// occurred in a status response. An operation may have multiple causes for a |
| 1044 |
// status (whether Failure or Success). |
| 1045 |
type CauseType string |
| 1046 |
|
| 1047 |
const ( |
| 1048 |
// CauseTypeFieldValueNotFound is used to report failure to find a requested value |
| 1049 |
// (e.g. looking up an ID). |
| 1050 |
CauseTypeFieldValueNotFound CauseType = "FieldValueNotFound" |
| 1051 |
// CauseTypeFieldValueRequired is used to report required values that are not |
| 1052 |
// provided (e.g. empty strings, null values, or empty arrays). |
| 1053 |
CauseTypeFieldValueRequired CauseType = "FieldValueRequired" |
| 1054 |
// CauseTypeFieldValueDuplicate is used to report collisions of values that must be |
| 1055 |
// unique (e.g. unique IDs). |
| 1056 |
CauseTypeFieldValueDuplicate CauseType = "FieldValueDuplicate" |
| 1057 |
// CauseTypeFieldValueInvalid is used to report malformed values (e.g. failed regex |
| 1058 |
// match). |
| 1059 |
CauseTypeFieldValueInvalid CauseType = "FieldValueInvalid" |
| 1060 |
// CauseTypeFieldValueNotSupported is used to report valid (as per formatting rules) |
| 1061 |
// values that can not be handled (e.g. an enumerated string). |
| 1062 |
CauseTypeFieldValueNotSupported CauseType = "FieldValueNotSupported" |
| 1063 |
// CauseTypeForbidden is used to report valid (as per formatting rules) |
| 1064 |
// values which would be accepted under some conditions, but which are not |
| 1065 |
// permitted by the current conditions (such as security policy). See |
| 1066 |
// Forbidden(). |
| 1067 |
CauseTypeForbidden CauseType = "FieldValueForbidden" |
| 1068 |
// CauseTypeTooLong is used to report that the given value is too long. |
| 1069 |
// This is similar to ErrorTypeInvalid, but the error will not include the |
| 1070 |
// too-long value. See TooLong(). |
| 1071 |
CauseTypeTooLong CauseType = "FieldValueTooLong" |
| 1072 |
// CauseTypeTooMany is used to report "too many". This is used to |
| 1073 |
// report that a given list has too many items. This is similar to FieldValueTooLong, |
| 1074 |
// but the error indicates quantity instead of length. |
| 1075 |
CauseTypeTooMany CauseType = "FieldValueTooMany" |
| 1076 |
// CauseTypeInternal is used to report other errors that are not related |
| 1077 |
// to user input. See InternalError(). |
| 1078 |
CauseTypeInternal CauseType = "InternalError" |
| 1079 |
// CauseTypeTypeInvalid is for the value did not match the schema type for that field |
| 1080 |
CauseTypeTypeInvalid CauseType = "FieldValueTypeInvalid" |
| 1081 |
// CauseTypeUnexpectedServerResponse is used to report when the server responded to the client |
| 1082 |
// without the expected return type. The presence of this cause indicates the error may be |
| 1083 |
// due to an intervening proxy or the server software malfunctioning. |
| 1084 |
CauseTypeUnexpectedServerResponse CauseType = "UnexpectedServerResponse" |
| 1085 |
// FieldManagerConflict is used to report when another client claims to manage this field, |
| 1086 |
// It should only be returned for a request using server-side apply. |
| 1087 |
CauseTypeFieldManagerConflict CauseType = "FieldManagerConflict" |
| 1088 |
// CauseTypeResourceVersionTooLarge is used to report that the requested resource version |
| 1089 |
// is newer than the data observed by the API server, so the request cannot be served. |
| 1090 |
CauseTypeResourceVersionTooLarge CauseType = "ResourceVersionTooLarge" |
| 1091 |
) |
| 1092 |
|
| 1093 |
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 1094 |
|
| 1095 |
// List holds a list of objects, which may not be known by the server. |
| 1096 |
type List struct { |
| 1097 |
TypeMeta `json:",inline"` |
| 1098 |
// Standard list metadata. |
| 1099 |
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds |
| 1100 |
// +optional |
| 1101 |
ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` |
| 1102 |
|
| 1103 |
// List of objects |
| 1104 |
Items []runtime.RawExtension `json:"items" protobuf:"bytes,2,rep,name=items"` |
| 1105 |
} |
| 1106 |
|
| 1107 |
// APIVersions lists the versions that are available, to allow clients to |
| 1108 |
// discover the API at /api, which is the root path of the legacy v1 API. |
| 1109 |
// |
| 1110 |
// +protobuf.options.(gogoproto.goproto_stringer)=false |
| 1111 |
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 1112 |
type APIVersions struct { |
| 1113 |
TypeMeta `json:",inline"` |
| 1114 |
// versions are the api versions that are available. |
| 1115 |
// +listType=atomic |
| 1116 |
Versions []string `json:"versions" protobuf:"bytes,1,rep,name=versions"` |
| 1117 |
// a map of client CIDR to server address that is serving this group. |
| 1118 |
// This is to help clients reach servers in the most network-efficient way possible. |
| 1119 |
// Clients can use the appropriate server address as per the CIDR that they match. |
| 1120 |
// In case of multiple matches, clients should use the longest matching CIDR. |
| 1121 |
// The server returns only those CIDRs that it thinks that the client can match. |
| 1122 |
// For example: the master will return an internal IP CIDR only, if the client reaches the server using an internal IP. |
| 1123 |
// Server looks at X-Forwarded-For header or X-Real-Ip header or request.RemoteAddr (in that order) to get the client IP. |
| 1124 |
// +listType=atomic |
| 1125 |
ServerAddressByClientCIDRs []ServerAddressByClientCIDR `json:"serverAddressByClientCIDRs" protobuf:"bytes,2,rep,name=serverAddressByClientCIDRs"` |
| 1126 |
} |
| 1127 |
|
| 1128 |
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 1129 |
|
| 1130 |
// APIGroupList is a list of APIGroup, to allow clients to discover the API at |
| 1131 |
// /apis. |
| 1132 |
type APIGroupList struct { |
| 1133 |
TypeMeta `json:",inline"` |
| 1134 |
// groups is a list of APIGroup. |
| 1135 |
// +listType=atomic |
| 1136 |
Groups []APIGroup `json:"groups" protobuf:"bytes,1,rep,name=groups"` |
| 1137 |
} |
| 1138 |
|
| 1139 |
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 1140 |
|
| 1141 |
// APIGroup contains the name, the supported versions, and the preferred version |
| 1142 |
// of a group. |
| 1143 |
type APIGroup struct { |
| 1144 |
TypeMeta `json:",inline"` |
| 1145 |
// name is the name of the group. |
| 1146 |
Name string `json:"name" protobuf:"bytes,1,opt,name=name"` |
| 1147 |
// versions are the versions supported in this group. |
| 1148 |
// +listType=atomic |
| 1149 |
Versions []GroupVersionForDiscovery `json:"versions" protobuf:"bytes,2,rep,name=versions"` |
| 1150 |
// preferredVersion is the version preferred by the API server, which |
| 1151 |
// probably is the storage version. |
| 1152 |
// +optional |
| 1153 |
PreferredVersion GroupVersionForDiscovery `json:"preferredVersion,omitempty" protobuf:"bytes,3,opt,name=preferredVersion"` |
| 1154 |
// a map of client CIDR to server address that is serving this group. |
| 1155 |
// This is to help clients reach servers in the most network-efficient way possible. |
| 1156 |
// Clients can use the appropriate server address as per the CIDR that they match. |
| 1157 |
// In case of multiple matches, clients should use the longest matching CIDR. |
| 1158 |
// The server returns only those CIDRs that it thinks that the client can match. |
| 1159 |
// For example: the master will return an internal IP CIDR only, if the client reaches the server using an internal IP. |
| 1160 |
// Server looks at X-Forwarded-For header or X-Real-Ip header or request.RemoteAddr (in that order) to get the client IP. |
| 1161 |
// +optional |
| 1162 |
// +listType=atomic |
| 1163 |
ServerAddressByClientCIDRs []ServerAddressByClientCIDR `json:"serverAddressByClientCIDRs,omitempty" protobuf:"bytes,4,rep,name=serverAddressByClientCIDRs"` |
| 1164 |
} |
| 1165 |
|
| 1166 |
// ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match. |
| 1167 |
type ServerAddressByClientCIDR struct { |
| 1168 |
// The CIDR with which clients can match their IP to figure out the server address that they should use. |
| 1169 |
ClientCIDR string `json:"clientCIDR" protobuf:"bytes,1,opt,name=clientCIDR"` |
| 1170 |
// Address of this server, suitable for a client that matches the above CIDR. |
| 1171 |
// This can be a hostname, hostname:port, IP or IP:port. |
| 1172 |
ServerAddress string `json:"serverAddress" protobuf:"bytes,2,opt,name=serverAddress"` |
| 1173 |
} |
| 1174 |
|
| 1175 |
// GroupVersion contains the "group/version" and "version" string of a version. |
| 1176 |
// It is made a struct to keep extensibility. |
| 1177 |
type GroupVersionForDiscovery struct { |
| 1178 |
// groupVersion specifies the API group and version in the form "group/version" |
| 1179 |
GroupVersion string `json:"groupVersion" protobuf:"bytes,1,opt,name=groupVersion"` |
| 1180 |
// version specifies the version in the form of "version". This is to save |
| 1181 |
// the clients the trouble of splitting the GroupVersion. |
| 1182 |
Version string `json:"version" protobuf:"bytes,2,opt,name=version"` |
| 1183 |
} |
| 1184 |
|
| 1185 |
// APIResource specifies the name of a resource and whether it is namespaced. |
| 1186 |
type APIResource struct { |
| 1187 |
// name is the plural name of the resource. |
| 1188 |
Name string `json:"name" protobuf:"bytes,1,opt,name=name"` |
| 1189 |
// singularName is the singular name of the resource. This allows clients to handle plural and singular opaquely. |
| 1190 |
// The singularName is more correct for reporting status on a single item and both singular and plural are allowed |
| 1191 |
// from the kubectl CLI interface. |
| 1192 |
SingularName string `json:"singularName" protobuf:"bytes,6,opt,name=singularName"` |
| 1193 |
// namespaced indicates if a resource is namespaced or not. |
| 1194 |
Namespaced bool `json:"namespaced" protobuf:"varint,2,opt,name=namespaced"` |
| 1195 |
// group is the preferred group of the resource. Empty implies the group of the containing resource list. |
| 1196 |
// For subresources, this may have a different value, for example: Scale". |
| 1197 |
Group string `json:"group,omitempty" protobuf:"bytes,8,opt,name=group"` |
| 1198 |
// version is the preferred version of the resource. Empty implies the version of the containing resource list |
| 1199 |
// For subresources, this may have a different value, for example: v1 (while inside a v1beta1 version of the core resource's group)". |
| 1200 |
Version string `json:"version,omitempty" protobuf:"bytes,9,opt,name=version"` |
| 1201 |
// kind is the kind for the resource (e.g. 'Foo' is the kind for a resource 'foo') |
| 1202 |
Kind string `json:"kind" protobuf:"bytes,3,opt,name=kind"` |
| 1203 |
// verbs is a list of supported kube verbs (this includes get, list, watch, create, |
| 1204 |
// update, patch, delete, deletecollection, and proxy) |
| 1205 |
Verbs Verbs `json:"verbs" protobuf:"bytes,4,opt,name=verbs"` |
| 1206 |
// shortNames is a list of suggested short names of the resource. |
| 1207 |
// +listType=atomic |
| 1208 |
ShortNames []string `json:"shortNames,omitempty" protobuf:"bytes,5,rep,name=shortNames"` |
| 1209 |
// categories is a list of the grouped resources this resource belongs to (e.g. 'all') |
| 1210 |
// +listType=atomic |
| 1211 |
Categories []string `json:"categories,omitempty" protobuf:"bytes,7,rep,name=categories"` |
| 1212 |
// The hash value of the storage version, the version this resource is |
| 1213 |
// converted to when written to the data store. Value must be treated |
| 1214 |
// as opaque by clients. Only equality comparison on the value is valid. |
| 1215 |
// This is an alpha feature and may change or be removed in the future. |
| 1216 |
// The field is populated by the apiserver only if the |
| 1217 |
// StorageVersionHash feature gate is enabled. |
| 1218 |
// This field will remain optional even if it graduates. |
| 1219 |
// +optional |
| 1220 |
StorageVersionHash string `json:"storageVersionHash,omitempty" protobuf:"bytes,10,opt,name=storageVersionHash"` |
| 1221 |
} |
| 1222 |
|
| 1223 |
// Verbs masks the value so protobuf can generate |
| 1224 |
// |
| 1225 |
// +protobuf.nullable=true |
| 1226 |
// +protobuf.options.(gogoproto.goproto_stringer)=false |
| 1227 |
type Verbs []string |
| 1228 |
|
| 1229 |
func (vs Verbs) String() string { |
| 1230 |
return fmt.Sprintf("%v", []string(vs)) |
| 1231 |
} |
| 1232 |
|
| 1233 |
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 1234 |
|
| 1235 |
// APIResourceList is a list of APIResource, it is used to expose the name of the |
| 1236 |
// resources supported in a specific group and version, and if the resource |
| 1237 |
// is namespaced. |
| 1238 |
type APIResourceList struct { |
| 1239 |
TypeMeta `json:",inline"` |
| 1240 |
// groupVersion is the group and version this APIResourceList is for. |
| 1241 |
GroupVersion string `json:"groupVersion" protobuf:"bytes,1,opt,name=groupVersion"` |
| 1242 |
// resources contains the name of the resources and if they are namespaced. |
| 1243 |
// +listType=atomic |
| 1244 |
APIResources []APIResource `json:"resources" protobuf:"bytes,2,rep,name=resources"` |
| 1245 |
} |
| 1246 |
|
| 1247 |
// RootPaths lists the paths available at root. |
| 1248 |
// For example: "/healthz", "/apis". |
| 1249 |
type RootPaths struct { |
| 1250 |
// paths are the paths available at root. |
| 1251 |
// +listType=atomic |
| 1252 |
Paths []string `json:"paths" protobuf:"bytes,1,rep,name=paths"` |
| 1253 |
} |
| 1254 |
|
| 1255 |
// TODO: remove me when watch is refactored |
| 1256 |
func LabelSelectorQueryParam(version string) string { |
| 1257 |
return "labelSelector" |
| 1258 |
} |
| 1259 |
|
| 1260 |
// TODO: remove me when watch is refactored |
| 1261 |
func FieldSelectorQueryParam(version string) string { |
| 1262 |
return "fieldSelector" |
| 1263 |
} |
| 1264 |
|
| 1265 |
// String returns available api versions as a human-friendly version string. |
| 1266 |
func (apiVersions APIVersions) String() string { |
| 1267 |
return strings.Join(apiVersions.Versions, ",") |
| 1268 |
} |
| 1269 |
|
| 1270 |
func (apiVersions APIVersions) GoString() string { |
| 1271 |
return apiVersions.String() |
| 1272 |
} |
| 1273 |
|
| 1274 |
// Patch is provided to give a concrete name and type to the Kubernetes PATCH request body. |
| 1275 |
type Patch struct{} |
| 1276 |
|
| 1277 |
// Note: |
| 1278 |
// There are two different styles of label selectors used in versioned types: |
| 1279 |
// an older style which is represented as just a string in versioned types, and a |
| 1280 |
// newer style that is structured. LabelSelector is an internal representation for the |
| 1281 |
// latter style. |
| 1282 |
|
| 1283 |
// A label selector is a label query over a set of resources. The result of matchLabels and |
| 1284 |
// matchExpressions are ANDed. An empty label selector matches all objects. A null |
| 1285 |
// label selector matches no objects. |
| 1286 |
// +structType=atomic |
| 1287 |
type LabelSelector struct { |
| 1288 |
// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels |
| 1289 |
// map is equivalent to an element of matchExpressions, whose key field is "key", the |
| 1290 |
// operator is "In", and the values array contains only "value". The requirements are ANDed. |
| 1291 |
// +optional |
| 1292 |
MatchLabels map[string]string `json:"matchLabels,omitempty" protobuf:"bytes,1,rep,name=matchLabels"` |
| 1293 |
// matchExpressions is a list of label selector requirements. The requirements are ANDed. |
| 1294 |
// +optional |
| 1295 |
// +listType=atomic |
| 1296 |
MatchExpressions []LabelSelectorRequirement `json:"matchExpressions,omitempty" protobuf:"bytes,2,rep,name=matchExpressions"` |
| 1297 |
} |
| 1298 |
|
| 1299 |
// A label selector requirement is a selector that contains values, a key, and an operator that |
| 1300 |
// relates the key and values. |
| 1301 |
type LabelSelectorRequirement struct { |
| 1302 |
// key is the label key that the selector applies to. |
| 1303 |
Key string `json:"key" protobuf:"bytes,1,opt,name=key"` |
| 1304 |
// operator represents a key's relationship to a set of values. |
| 1305 |
// Valid operators are In, NotIn, Exists and DoesNotExist. |
| 1306 |
Operator LabelSelectorOperator `json:"operator" protobuf:"bytes,2,opt,name=operator,casttype=LabelSelectorOperator"` |
| 1307 |
// values is an array of string values. If the operator is In or NotIn, |
| 1308 |
// the values array must be non-empty. If the operator is Exists or DoesNotExist, |
| 1309 |
// the values array must be empty. This array is replaced during a strategic |
| 1310 |
// merge patch. |
| 1311 |
// +optional |
| 1312 |
// +listType=atomic |
| 1313 |
Values []string `json:"values,omitempty" protobuf:"bytes,3,rep,name=values"` |
| 1314 |
} |
| 1315 |
|
| 1316 |
// A label selector operator is the set of operators that can be used in a selector requirement. |
| 1317 |
type LabelSelectorOperator string |
| 1318 |
|
| 1319 |
const ( |
| 1320 |
LabelSelectorOpIn LabelSelectorOperator = "In" |
| 1321 |
LabelSelectorOpNotIn LabelSelectorOperator = "NotIn" |
| 1322 |
LabelSelectorOpExists LabelSelectorOperator = "Exists" |
| 1323 |
LabelSelectorOpDoesNotExist LabelSelectorOperator = "DoesNotExist" |
| 1324 |
) |
| 1325 |
|
| 1326 |
// FieldSelectorRequirement is a selector that contains values, a key, and an operator that |
| 1327 |
// relates the key and values. |
| 1328 |
type FieldSelectorRequirement struct { |
| 1329 |
// key is the field selector key that the requirement applies to. |
| 1330 |
Key string `json:"key" protobuf:"bytes,1,opt,name=key"` |
| 1331 |
// operator represents a key's relationship to a set of values. |
| 1332 |
// Valid operators are In, NotIn, Exists, DoesNotExist. |
| 1333 |
// The list of operators may grow in the future. |
| 1334 |
Operator FieldSelectorOperator `json:"operator" protobuf:"bytes,2,opt,name=operator,casttype=FieldSelectorOperator"` |
| 1335 |
// values is an array of string values. |
| 1336 |
// If the operator is In or NotIn, the values array must be non-empty. |
| 1337 |
// If the operator is Exists or DoesNotExist, the values array must be empty. |
| 1338 |
// +optional |
| 1339 |
// +listType=atomic |
| 1340 |
Values []string `json:"values,omitempty" protobuf:"bytes,3,rep,name=values"` |
| 1341 |
} |
| 1342 |
|
| 1343 |
// A field selector operator is the set of operators that can be used in a selector requirement. |
| 1344 |
type FieldSelectorOperator string |
| 1345 |
|
| 1346 |
const ( |
| 1347 |
FieldSelectorOpIn FieldSelectorOperator = "In" |
| 1348 |
FieldSelectorOpNotIn FieldSelectorOperator = "NotIn" |
| 1349 |
FieldSelectorOpExists FieldSelectorOperator = "Exists" |
| 1350 |
FieldSelectorOpDoesNotExist FieldSelectorOperator = "DoesNotExist" |
| 1351 |
) |
| 1352 |
|
| 1353 |
// ManagedFieldsEntry is a workflow-id, a FieldSet and the group version of the resource |
| 1354 |
// that the fieldset applies to. |
| 1355 |
type ManagedFieldsEntry struct { |
| 1356 |
// Manager is an identifier of the workflow managing these fields. |
| 1357 |
Manager string `json:"manager,omitempty" protobuf:"bytes,1,opt,name=manager"` |
| 1358 |
// Operation is the type of operation which lead to this ManagedFieldsEntry being created. |
| 1359 |
// The only valid values for this field are 'Apply' and 'Update'. |
| 1360 |
Operation ManagedFieldsOperationType `json:"operation,omitempty" protobuf:"bytes,2,opt,name=operation,casttype=ManagedFieldsOperationType"` |
| 1361 |
// APIVersion defines the version of this resource that this field set |
| 1362 |
// applies to. The format is "group/version" just like the top-level |
| 1363 |
// APIVersion field. It is necessary to track the version of a field |
| 1364 |
// set because it cannot be automatically converted. |
| 1365 |
APIVersion string `json:"apiVersion,omitempty" protobuf:"bytes,3,opt,name=apiVersion"` |
| 1366 |
// Time is the timestamp of when the ManagedFields entry was added. The |
| 1367 |
// timestamp will also be updated if a field is added, the manager |
| 1368 |
// changes any of the owned fields value or removes a field. The |
| 1369 |
// timestamp does not update when a field is removed from the entry |
| 1370 |
// because another manager took it over. |
| 1371 |
// +optional |
| 1372 |
Time *Time `json:"time,omitempty" protobuf:"bytes,4,opt,name=time"` |
| 1373 |
|
| 1374 |
// Fields is tombstoned to show why 5 is a reserved protobuf tag. |
| 1375 |
//Fields *Fields `json:"fields,omitempty" protobuf:"bytes,5,opt,name=fields,casttype=Fields"` |
| 1376 |
|
| 1377 |
// FieldsType is the discriminator for the different fields format and version. |
| 1378 |
// There is currently only one possible value: "FieldsV1" |
| 1379 |
FieldsType string `json:"fieldsType,omitempty" protobuf:"bytes,6,opt,name=fieldsType"` |
| 1380 |
// FieldsV1 holds the first JSON version format as described in the "FieldsV1" type. |
| 1381 |
// +optional |
| 1382 |
FieldsV1 *FieldsV1 `json:"fieldsV1,omitempty" protobuf:"bytes,7,opt,name=fieldsV1"` |
| 1383 |
|
| 1384 |
// Subresource is the name of the subresource used to update that object, or |
| 1385 |
// empty string if the object was updated through the main resource. The |
| 1386 |
// value of this field is used to distinguish between managers, even if they |
| 1387 |
// share the same name. For example, a status update will be distinct from a |
| 1388 |
// regular update using the same manager name. |
| 1389 |
// Note that the APIVersion field is not related to the Subresource field and |
| 1390 |
// it always corresponds to the version of the main resource. |
| 1391 |
Subresource string `json:"subresource,omitempty" protobuf:"bytes,8,opt,name=subresource"` |
| 1392 |
} |
| 1393 |
|
| 1394 |
// ManagedFieldsOperationType is the type of operation which lead to a ManagedFieldsEntry being created. |
| 1395 |
type ManagedFieldsOperationType string |
| 1396 |
|
| 1397 |
const ( |
| 1398 |
ManagedFieldsOperationApply ManagedFieldsOperationType = "Apply" |
| 1399 |
ManagedFieldsOperationUpdate ManagedFieldsOperationType = "Update" |
| 1400 |
) |
| 1401 |
|
| 1402 |
// FieldsV1 stores a set of fields in a data structure like a Trie, in JSON format. |
| 1403 |
// |
| 1404 |
// Each key is either a '.' representing the field itself, and will always map to an empty set, |
| 1405 |
// or a string representing a sub-field or item. The string will follow one of these four formats: |
| 1406 |
// 'f:<name>', where <name> is the name of a field in a struct, or key in a map |
| 1407 |
// 'v:<value>', where <value> is the exact json formatted value of a list item |
| 1408 |
// 'i:<index>', where <index> is position of a item in a list |
| 1409 |
// 'k:<keys>', where <keys> is a map of a list item's key fields to their unique values |
| 1410 |
// If a key maps to an empty Fields value, the field that key represents is part of the set. |
| 1411 |
// |
| 1412 |
// The exact format is defined in sigs.k8s.io/structured-merge-diff |
| 1413 |
// +protobuf.options.(gogoproto.goproto_stringer)=false |
| 1414 |
type FieldsV1 struct { |
| 1415 |
// Raw is the underlying serialization of this object. |
| 1416 |
Raw []byte `json:"-" protobuf:"bytes,1,opt,name=Raw"` |
| 1417 |
} |
| 1418 |
|
| 1419 |
func (f FieldsV1) String() string { |
| 1420 |
return string(f.Raw) |
| 1421 |
} |
| 1422 |
|
| 1423 |
// TODO: Table does not generate to protobuf because of the interface{} - fix protobuf |
| 1424 |
// generation to support a meta type that can accept any valid JSON. This can be introduced |
| 1425 |
// in a v1 because clients a) receive an error if they try to access proto today, and b) |
| 1426 |
// once introduced they would be able to gracefully switch over to using it. |
| 1427 |
|
| 1428 |
// Table is a tabular representation of a set of API resources. The server transforms the |
| 1429 |
// object into a set of preferred columns for quickly reviewing the objects. |
| 1430 |
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 1431 |
// +protobuf=false |
| 1432 |
type Table struct { |
| 1433 |
TypeMeta `json:",inline"` |
| 1434 |
// Standard list metadata. |
| 1435 |
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds |
| 1436 |
// +optional |
| 1437 |
ListMeta `json:"metadata,omitempty"` |
| 1438 |
|
| 1439 |
// columnDefinitions describes each column in the returned items array. The number of cells per row |
| 1440 |
// will always match the number of column definitions. |
| 1441 |
// +listType=atomic |
| 1442 |
ColumnDefinitions []TableColumnDefinition `json:"columnDefinitions"` |
| 1443 |
// rows is the list of items in the table. |
| 1444 |
// +listType=atomic |
| 1445 |
Rows []TableRow `json:"rows"` |
| 1446 |
} |
| 1447 |
|
| 1448 |
// TableColumnDefinition contains information about a column returned in the Table. |
| 1449 |
// +protobuf=false |
| 1450 |
type TableColumnDefinition struct { |
| 1451 |
// name is a human readable name for the column. |
| 1452 |
Name string `json:"name"` |
| 1453 |
// type is an OpenAPI type definition for this column, such as number, integer, string, or |
| 1454 |
// array. |
| 1455 |
// See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for more. |
| 1456 |
Type string `json:"type"` |
| 1457 |
// format is an optional OpenAPI type modifier for this column. A format modifies the type and |
| 1458 |
// imposes additional rules, like date or time formatting for a string. The 'name' format is applied |
| 1459 |
// to the primary identifier column which has type 'string' to assist in clients identifying column |
| 1460 |
// is the resource name. |
| 1461 |
// See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for more. |
| 1462 |
Format string `json:"format"` |
| 1463 |
// description is a human readable description of this column. |
| 1464 |
Description string `json:"description"` |
| 1465 |
// priority is an integer defining the relative importance of this column compared to others. Lower |
| 1466 |
// numbers are considered higher priority. Columns that may be omitted in limited space scenarios |
| 1467 |
// should be given a higher priority. |
| 1468 |
Priority int32 `json:"priority"` |
| 1469 |
} |
| 1470 |
|
| 1471 |
// TableRow is an individual row in a table. |
| 1472 |
// +protobuf=false |
| 1473 |
type TableRow struct { |
| 1474 |
// cells will be as wide as the column definitions array and may contain strings, numbers (float64 or |
| 1475 |
// int64), booleans, simple maps, lists, or null. See the type field of the column definition for a |
| 1476 |
// more detailed description. |
| 1477 |
// +listType=atomic |
| 1478 |
Cells []interface{} `json:"cells"` |
| 1479 |
// conditions describe additional status of a row that are relevant for a human user. These conditions |
| 1480 |
// apply to the row, not to the object, and will be specific to table output. The only defined |
| 1481 |
// condition type is 'Completed', for a row that indicates a resource that has run to completion and |
| 1482 |
// can be given less visual priority. |
| 1483 |
// +optional |
| 1484 |
// +listType=atomic |
| 1485 |
Conditions []TableRowCondition `json:"conditions,omitempty"` |
| 1486 |
// This field contains the requested additional information about each object based on the includeObject |
| 1487 |
// policy when requesting the Table. If "None", this field is empty, if "Object" this will be the |
| 1488 |
// default serialization of the object for the current API version, and if "Metadata" (the default) will |
| 1489 |
// contain the object metadata. Check the returned kind and apiVersion of the object before parsing. |
| 1490 |
// The media type of the object will always match the enclosing list - if this as a JSON table, these |
| 1491 |
// will be JSON encoded objects. |
| 1492 |
// +optional |
| 1493 |
Object runtime.RawExtension `json:"object,omitempty"` |
| 1494 |
} |
| 1495 |
|
| 1496 |
// TableRowCondition allows a row to be marked with additional information. |
| 1497 |
// +protobuf=false |
| 1498 |
type TableRowCondition struct { |
| 1499 |
// Type of row condition. The only defined value is 'Completed' indicating that the |
| 1500 |
// object this row represents has reached a completed state and may be given less visual |
| 1501 |
// priority than other rows. Clients are not required to honor any conditions but should |
| 1502 |
// be consistent where possible about handling the conditions. |
| 1503 |
Type RowConditionType `json:"type"` |
| 1504 |
// Status of the condition, one of True, False, Unknown. |
| 1505 |
Status ConditionStatus `json:"status"` |
| 1506 |
// (brief) machine readable reason for the condition's last transition. |
| 1507 |
// +optional |
| 1508 |
Reason string `json:"reason,omitempty"` |
| 1509 |
// Human readable message indicating details about last transition. |
| 1510 |
// +optional |
| 1511 |
Message string `json:"message,omitempty"` |
| 1512 |
} |
| 1513 |
|
| 1514 |
type RowConditionType string |
| 1515 |
|
| 1516 |
// These are valid conditions of a row. This list is not exhaustive and new conditions may be |
| 1517 |
// included by other resources. |
| 1518 |
const ( |
| 1519 |
// RowCompleted means the underlying resource has reached completion and may be given less |
| 1520 |
// visual priority than other resources. |
| 1521 |
RowCompleted RowConditionType = "Completed" |
| 1522 |
) |
| 1523 |
|
| 1524 |
type ConditionStatus string |
| 1525 |
|
| 1526 |
// These are valid condition statuses. "ConditionTrue" means a resource is in the condition. |
| 1527 |
// "ConditionFalse" means a resource is not in the condition. "ConditionUnknown" means kubernetes |
| 1528 |
// can't decide if a resource is in the condition or not. In the future, we could add other |
| 1529 |
// intermediate conditions, e.g. ConditionDegraded. |
| 1530 |
const ( |
| 1531 |
ConditionTrue ConditionStatus = "True" |
| 1532 |
ConditionFalse ConditionStatus = "False" |
| 1533 |
ConditionUnknown ConditionStatus = "Unknown" |
| 1534 |
) |
| 1535 |
|
| 1536 |
// IncludeObjectPolicy controls which portion of the object is returned with a Table. |
| 1537 |
type IncludeObjectPolicy string |
| 1538 |
|
| 1539 |
const ( |
| 1540 |
// IncludeNone returns no object. |
| 1541 |
IncludeNone IncludeObjectPolicy = "None" |
| 1542 |
// IncludeMetadata serializes the object containing only its metadata field. |
| 1543 |
IncludeMetadata IncludeObjectPolicy = "Metadata" |
| 1544 |
// IncludeObject contains the full object. |
| 1545 |
IncludeObject IncludeObjectPolicy = "Object" |
| 1546 |
) |
| 1547 |
|
| 1548 |
// TableOptions are used when a Table is requested by the caller. |
| 1549 |
// +k8s:conversion-gen:explicit-from=net/url.Values |
| 1550 |
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 1551 |
type TableOptions struct { |
| 1552 |
TypeMeta `json:",inline"` |
| 1553 |
|
| 1554 |
// NoHeaders is only exposed for internal callers. It is not included in our OpenAPI definitions |
| 1555 |
// and may be removed as a field in a future release. |
| 1556 |
NoHeaders bool `json:"-"` |
| 1557 |
|
| 1558 |
// includeObject decides whether to include each object along with its columnar information. |
| 1559 |
// Specifying "None" will return no object, specifying "Object" will return the full object contents, and |
| 1560 |
// specifying "Metadata" (the default) will return the object's metadata in the PartialObjectMetadata kind |
| 1561 |
// in version v1beta1 of the meta.k8s.io API group. |
| 1562 |
IncludeObject IncludeObjectPolicy `json:"includeObject,omitempty" protobuf:"bytes,1,opt,name=includeObject,casttype=IncludeObjectPolicy"` |
| 1563 |
} |
| 1564 |
|
| 1565 |
// PartialObjectMetadata is a generic representation of any object with ObjectMeta. It allows clients |
| 1566 |
// to get access to a particular ObjectMeta schema without knowing the details of the version. |
| 1567 |
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 1568 |
type PartialObjectMetadata struct { |
| 1569 |
TypeMeta `json:",inline"` |
| 1570 |
// Standard object's metadata. |
| 1571 |
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata |
| 1572 |
// +optional |
| 1573 |
ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` |
| 1574 |
} |
| 1575 |
|
| 1576 |
// PartialObjectMetadataList contains a list of objects containing only their metadata |
| 1577 |
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 1578 |
type PartialObjectMetadataList struct { |
| 1579 |
TypeMeta `json:",inline"` |
| 1580 |
// Standard list metadata. |
| 1581 |
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds |
| 1582 |
// +optional |
| 1583 |
ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` |
| 1584 |
|
| 1585 |
// items contains each of the included items. |
| 1586 |
Items []PartialObjectMetadata `json:"items" protobuf:"bytes,2,rep,name=items"` |
| 1587 |
} |
| 1588 |
|
| 1589 |
// Condition contains details for one aspect of the current state of this API Resource. |
| 1590 |
// --- |
| 1591 |
// This struct is intended for direct use as an array at the field path .status.conditions. For example, |
| 1592 |
// |
| 1593 |
// type FooStatus struct{ |
| 1594 |
// // Represents the observations of a foo's current state. |
| 1595 |
// // Known .status.conditions.type are: "Available", "Progressing", and "Degraded" |
| 1596 |
// // +patchMergeKey=type |
| 1597 |
// // +patchStrategy=merge |
| 1598 |
// // +listType=map |
| 1599 |
// // +listMapKey=type |
| 1600 |
// Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` |
| 1601 |
// |
| 1602 |
// // other fields |
| 1603 |
// } |
| 1604 |
type Condition struct { |
| 1605 |
// type of condition in CamelCase or in foo.example.com/CamelCase. |
| 1606 |
// --- |
| 1607 |
// Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be |
| 1608 |
// useful (see .node.status.conditions), the ability to deconflict is important. |
| 1609 |
// The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) |
| 1610 |
// +required |
| 1611 |
// +kubebuilder:validation:Required |
| 1612 |
// +kubebuilder:validation:Pattern=`^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$` |
| 1613 |
// +kubebuilder:validation:MaxLength=316 |
| 1614 |
Type string `json:"type" protobuf:"bytes,1,opt,name=type"` |
| 1615 |
// status of the condition, one of True, False, Unknown. |
| 1616 |
// +required |
| 1617 |
// +kubebuilder:validation:Required |
| 1618 |
// +kubebuilder:validation:Enum=True;False;Unknown |
| 1619 |
Status ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status"` |
| 1620 |
// observedGeneration represents the .metadata.generation that the condition was set based upon. |
| 1621 |
// For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date |
| 1622 |
// with respect to the current state of the instance. |
| 1623 |
// +optional |
| 1624 |
// +kubebuilder:validation:Minimum=0 |
| 1625 |
ObservedGeneration int64 `json:"observedGeneration,omitempty" protobuf:"varint,3,opt,name=observedGeneration"` |
| 1626 |
// lastTransitionTime is the last time the condition transitioned from one status to another. |
| 1627 |
// This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. |
| 1628 |
// +required |
| 1629 |
// +kubebuilder:validation:Required |
| 1630 |
// +kubebuilder:validation:Type=string |
| 1631 |
// +kubebuilder:validation:Format=date-time |
| 1632 |
LastTransitionTime Time `json:"lastTransitionTime" protobuf:"bytes,4,opt,name=lastTransitionTime"` |
| 1633 |
// reason contains a programmatic identifier indicating the reason for the condition's last transition. |
| 1634 |
// Producers of specific condition types may define expected values and meanings for this field, |
| 1635 |
// and whether the values are considered a guaranteed API. |
| 1636 |
// The value should be a CamelCase string. |
| 1637 |
// This field may not be empty. |
| 1638 |
// +required |
| 1639 |
// +kubebuilder:validation:Required |
| 1640 |
// +kubebuilder:validation:MaxLength=1024 |
| 1641 |
// +kubebuilder:validation:MinLength=1 |
| 1642 |
// +kubebuilder:validation:Pattern=`^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$` |
| 1643 |
Reason string `json:"reason" protobuf:"bytes,5,opt,name=reason"` |
| 1644 |
// message is a human readable message indicating details about the transition. |
| 1645 |
// This may be an empty string. |
| 1646 |
// +required |
| 1647 |
// +kubebuilder:validation:Required |
| 1648 |
// +kubebuilder:validation:MaxLength=32768 |
| 1649 |
Message string `json:"message" protobuf:"bytes,6,opt,name=message"` |
| 1650 |
} |