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 444 // resourceVersionMatch specifies how the resourceVersion parameter is applied. resourceVersionMatch 445 // may only be set if resourceVersion is also set. 446 // 447 // "NotOlderThan" matches data at least as new as the provided resourceVersion. 448 // "Exact" matches data at the exact resourceVersion provided. 449 // 450 // See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for 451 // details. 452 type ResourceVersionMatch string 453 454 const ( 455 // ResourceVersionMatchNotOlderThan matches data at least as new as the provided 456 // resourceVersion. 457 ResourceVersionMatchNotOlderThan ResourceVersionMatch = "NotOlderThan" 458 // ResourceVersionMatchExact matches data at the exact resourceVersion 459 // provided. 460 ResourceVersionMatchExact ResourceVersionMatch = "Exact" 461 ) 462 463 // +k8s:conversion-gen:explicit-from=net/url.Values 464 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 465 466 // GetOptions is the standard query options to the standard REST get call. 467 type GetOptions struct { 468 TypeMeta `json:",inline"` 469 // resourceVersion sets a constraint on what resource versions a request may be served from. 470 // See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for 471 // details. 472 // 473 // Defaults to unset 474 // +optional 475 ResourceVersion string `json:"resourceVersion,omitempty" protobuf:"bytes,1,opt,name=resourceVersion"` 476 // +k8s:deprecated=includeUninitialized,protobuf=2 477 } 478 479 // DeletionPropagation decides if a deletion will propagate to the dependents of 480 // the object, and how the garbage collector will handle the propagation. 481 type DeletionPropagation string 482 483 const ( 484 // Orphans the dependents. 485 DeletePropagationOrphan DeletionPropagation = "Orphan" 486 // Deletes the object from the key-value store, the garbage collector will 487 // delete the dependents in the background. 488 DeletePropagationBackground DeletionPropagation = "Background" 489 // The object exists in the key-value store until the garbage collector 490 // deletes all the dependents whose ownerReference.blockOwnerDeletion=true 491 // from the key-value store. API sever will put the "foregroundDeletion" 492 // finalizer on the object, and sets its deletionTimestamp. This policy is 493 // cascading, i.e., the dependents will be deleted with Foreground. 494 DeletePropagationForeground DeletionPropagation = "Foreground" 495 ) 496 497 const ( 498 // DryRunAll means to complete all processing stages, but don't 499 // persist changes to storage. 500 DryRunAll = "All" 501 ) 502 503 // +k8s:conversion-gen:explicit-from=net/url.Values 504 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 505 506 // DeleteOptions may be provided when deleting an API object. 507 type DeleteOptions struct { 508 TypeMeta `json:",inline"` 509 510 // The duration in seconds before the object should be deleted. Value must be non-negative integer. 511 // The value zero indicates delete immediately. If this value is nil, the default grace period for the 512 // specified type will be used. 513 // Defaults to a per object value if not specified. zero means delete immediately. 514 // +optional 515 GracePeriodSeconds *int64 `json:"gracePeriodSeconds,omitempty" protobuf:"varint,1,opt,name=gracePeriodSeconds"` 516 517 // Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be 518 // returned. 519 // +k8s:conversion-gen=false 520 // +optional 521 Preconditions *Preconditions `json:"preconditions,omitempty" protobuf:"bytes,2,opt,name=preconditions"` 522 523 // Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. 524 // Should the dependent objects be orphaned. If true/false, the "orphan" 525 // finalizer will be added to/removed from the object's finalizers list. 526 // Either this field or PropagationPolicy may be set, but not both. 527 // +optional 528 OrphanDependents *bool `json:"orphanDependents,omitempty" protobuf:"varint,3,opt,name=orphanDependents"` 529 530 // Whether and how garbage collection will be performed. 531 // Either this field or OrphanDependents may be set, but not both. 532 // The default policy is decided by the existing finalizer set in the 533 // metadata.finalizers and the resource-specific default policy. 534 // Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - 535 // allow the garbage collector to delete the dependents in the background; 536 // 'Foreground' - a cascading policy that deletes all dependents in the 537 // foreground. 538 // +optional 539 PropagationPolicy *DeletionPropagation `json:"propagationPolicy,omitempty" protobuf:"varint,4,opt,name=propagationPolicy"` 540 541 // When present, indicates that modifications should not be 542 // persisted. An invalid or unrecognized dryRun directive will 543 // result in an error response and no further processing of the 544 // request. Valid values are: 545 // - All: all dry run stages will be processed 546 // +optional 547 // +listType=atomic 548 DryRun []string `json:"dryRun,omitempty" protobuf:"bytes,5,rep,name=dryRun"` 549 } 550 551 const ( 552 // FieldValidationIgnore ignores unknown/duplicate fields 553 FieldValidationIgnore = "Ignore" 554 // FieldValidationWarn responds with a warning, but successfully serve the request 555 FieldValidationWarn = "Warn" 556 // FieldValidationStrict fails the request on unknown/duplicate fields 557 FieldValidationStrict = "Strict" 558 ) 559 560 // +k8s:conversion-gen:explicit-from=net/url.Values 561 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 562 563 // CreateOptions may be provided when creating an API object. 564 type CreateOptions struct { 565 TypeMeta `json:",inline"` 566 567 // When present, indicates that modifications should not be 568 // persisted. An invalid or unrecognized dryRun directive will 569 // result in an error response and no further processing of the 570 // request. Valid values are: 571 // - All: all dry run stages will be processed 572 // +optional 573 // +listType=atomic 574 DryRun []string `json:"dryRun,omitempty" protobuf:"bytes,1,rep,name=dryRun"` 575 // +k8s:deprecated=includeUninitialized,protobuf=2 576 577 // fieldManager is a name associated with the actor or entity 578 // that is making these changes. The value must be less than or 579 // 128 characters long, and only contain printable characters, 580 // as defined by https://golang.org/pkg/unicode/#IsPrint. 581 // +optional 582 FieldManager string `json:"fieldManager,omitempty" protobuf:"bytes,3,name=fieldManager"` 583 584 // fieldValidation instructs the server on how to handle 585 // objects in the request (POST/PUT/PATCH) containing unknown 586 // or duplicate fields. Valid values are: 587 // - Ignore: This will ignore any unknown fields that are silently 588 // dropped from the object, and will ignore all but the last duplicate 589 // field that the decoder encounters. This is the default behavior 590 // prior to v1.23. 591 // - Warn: This will send a warning via the standard warning response 592 // header for each unknown field that is dropped from the object, and 593 // for each duplicate field that is encountered. The request will 594 // still succeed if there are no other errors, and will only persist 595 // the last of any duplicate fields. This is the default in v1.23+ 596 // - Strict: This will fail the request with a BadRequest error if 597 // any unknown fields would be dropped from the object, or if any 598 // duplicate fields are present. The error returned from the server 599 // will contain all unknown and duplicate fields encountered. 600 // +optional 601 FieldValidation string `json:"fieldValidation,omitempty" protobuf:"bytes,4,name=fieldValidation"` 602 } 603 604 // +k8s:conversion-gen:explicit-from=net/url.Values 605 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 606 607 // PatchOptions may be provided when patching an API object. 608 // PatchOptions is meant to be a superset of UpdateOptions. 609 type PatchOptions struct { 610 TypeMeta `json:",inline"` 611 612 // When present, indicates that modifications should not be 613 // persisted. An invalid or unrecognized dryRun directive will 614 // result in an error response and no further processing of the 615 // request. Valid values are: 616 // - All: all dry run stages will be processed 617 // +optional 618 // +listType=atomic 619 DryRun []string `json:"dryRun,omitempty" protobuf:"bytes,1,rep,name=dryRun"` 620 621 // Force is going to "force" Apply requests. It means user will 622 // re-acquire conflicting fields owned by other people. Force 623 // flag must be unset for non-apply patch requests. 624 // +optional 625 Force *bool `json:"force,omitempty" protobuf:"varint,2,opt,name=force"` 626 627 // fieldManager is a name associated with the actor or entity 628 // that is making these changes. The value must be less than or 629 // 128 characters long, and only contain printable characters, 630 // as defined by https://golang.org/pkg/unicode/#IsPrint. This 631 // field is required for apply requests 632 // (application/apply-patch) but optional for non-apply patch 633 // types (JsonPatch, MergePatch, StrategicMergePatch). 634 // +optional 635 FieldManager string `json:"fieldManager,omitempty" protobuf:"bytes,3,name=fieldManager"` 636 637 // fieldValidation instructs the server on how to handle 638 // objects in the request (POST/PUT/PATCH) containing unknown 639 // or duplicate fields. Valid values are: 640 // - Ignore: This will ignore any unknown fields that are silently 641 // dropped from the object, and will ignore all but the last duplicate 642 // field that the decoder encounters. This is the default behavior 643 // prior to v1.23. 644 // - Warn: This will send a warning via the standard warning response 645 // header for each unknown field that is dropped from the object, and 646 // for each duplicate field that is encountered. The request will 647 // still succeed if there are no other errors, and will only persist 648 // the last of any duplicate fields. This is the default in v1.23+ 649 // - Strict: This will fail the request with a BadRequest error if 650 // any unknown fields would be dropped from the object, or if any 651 // duplicate fields are present. The error returned from the server 652 // will contain all unknown and duplicate fields encountered. 653 // +optional 654 FieldValidation string `json:"fieldValidation,omitempty" protobuf:"bytes,4,name=fieldValidation"` 655 } 656 657 // ApplyOptions may be provided when applying an API object. 658 // FieldManager is required for apply requests. 659 // ApplyOptions is equivalent to PatchOptions. It is provided as a convenience with documentation 660 // that speaks specifically to how the options fields relate to apply. 661 type ApplyOptions struct { 662 TypeMeta `json:",inline"` 663 664 // When present, indicates that modifications should not be 665 // persisted. An invalid or unrecognized dryRun directive will 666 // result in an error response and no further processing of the 667 // request. Valid values are: 668 // - All: all dry run stages will be processed 669 // +optional 670 // +listType=atomic 671 DryRun []string `json:"dryRun,omitempty" protobuf:"bytes,1,rep,name=dryRun"` 672 673 // Force is going to "force" Apply requests. It means user will 674 // re-acquire conflicting fields owned by other people. 675 Force bool `json:"force" protobuf:"varint,2,opt,name=force"` 676 677 // fieldManager is a name associated with the actor or entity 678 // that is making these changes. The value must be less than or 679 // 128 characters long, and only contain printable characters, 680 // as defined by https://golang.org/pkg/unicode/#IsPrint. This 681 // field is required. 682 FieldManager string `json:"fieldManager" protobuf:"bytes,3,name=fieldManager"` 683 } 684 685 func (o ApplyOptions) ToPatchOptions() PatchOptions { 686 return PatchOptions{DryRun: o.DryRun, Force: &o.Force, FieldManager: o.FieldManager} 687 } 688 689 // +k8s:conversion-gen:explicit-from=net/url.Values 690 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 691 692 // UpdateOptions may be provided when updating an API object. 693 // All fields in UpdateOptions should also be present in PatchOptions. 694 type UpdateOptions struct { 695 TypeMeta `json:",inline"` 696 697 // When present, indicates that modifications should not be 698 // persisted. An invalid or unrecognized dryRun directive will 699 // result in an error response and no further processing of the 700 // request. Valid values are: 701 // - All: all dry run stages will be processed 702 // +optional 703 // +listType=atomic 704 DryRun []string `json:"dryRun,omitempty" protobuf:"bytes,1,rep,name=dryRun"` 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. 710 // +optional 711 FieldManager string `json:"fieldManager,omitempty" protobuf:"bytes,2,name=fieldManager"` 712 713 // fieldValidation instructs the server on how to handle 714 // objects in the request (POST/PUT/PATCH) containing unknown 715 // or duplicate fields. Valid values are: 716 // - Ignore: This will ignore any unknown fields that are silently 717 // dropped from the object, and will ignore all but the last duplicate 718 // field that the decoder encounters. This is the default behavior 719 // prior to v1.23. 720 // - Warn: This will send a warning via the standard warning response 721 // header for each unknown field that is dropped from the object, and 722 // for each duplicate field that is encountered. The request will 723 // still succeed if there are no other errors, and will only persist 724 // the last of any duplicate fields. This is the default in v1.23+ 725 // - Strict: This will fail the request with a BadRequest error if 726 // any unknown fields would be dropped from the object, or if any 727 // duplicate fields are present. The error returned from the server 728 // will contain all unknown and duplicate fields encountered. 729 // +optional 730 FieldValidation string `json:"fieldValidation,omitempty" protobuf:"bytes,3,name=fieldValidation"` 731 } 732 733 // Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out. 734 type Preconditions struct { 735 // Specifies the target UID. 736 // +optional 737 UID *types.UID `json:"uid,omitempty" protobuf:"bytes,1,opt,name=uid,casttype=k8s.io/apimachinery/pkg/types.UID"` 738 // Specifies the target ResourceVersion 739 // +optional 740 ResourceVersion *string `json:"resourceVersion,omitempty" protobuf:"bytes,2,opt,name=resourceVersion"` 741 } 742 743 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 744 745 // Status is a return value for calls that don't return other objects. 746 type Status struct { 747 TypeMeta `json:",inline"` 748 // Standard list metadata. 749 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds 750 // +optional 751 ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 752 753 // Status of the operation. 754 // One of: "Success" or "Failure". 755 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 756 // +optional 757 Status string `json:"status,omitempty" protobuf:"bytes,2,opt,name=status"` 758 // A human-readable description of the status of this operation. 759 // +optional 760 Message string `json:"message,omitempty" protobuf:"bytes,3,opt,name=message"` 761 // A machine-readable description of why this operation is in the 762 // "Failure" status. If this value is empty there 763 // is no information available. A Reason clarifies an HTTP status 764 // code but does not override it. 765 // +optional 766 Reason StatusReason `json:"reason,omitempty" protobuf:"bytes,4,opt,name=reason,casttype=StatusReason"` 767 // Extended data associated with the reason. Each reason may define its 768 // own extended details. This field is optional and the data returned 769 // is not guaranteed to conform to any schema except that defined by 770 // the reason type. 771 // +optional 772 // +listType=atomic 773 Details *StatusDetails `json:"details,omitempty" protobuf:"bytes,5,opt,name=details"` 774 // Suggested HTTP return code for this status, 0 if not set. 775 // +optional 776 Code int32 `json:"code,omitempty" protobuf:"varint,6,opt,name=code"` 777 } 778 779 // StatusDetails is a set of additional properties that MAY be set by the 780 // server to provide additional information about a response. The Reason 781 // field of a Status object defines what attributes will be set. Clients 782 // must ignore fields that do not match the defined type of each attribute, 783 // and should assume that any attribute may be empty, invalid, or under 784 // defined. 785 type StatusDetails struct { 786 // The name attribute of the resource associated with the status StatusReason 787 // (when there is a single name which can be described). 788 // +optional 789 Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"` 790 // The group attribute of the resource associated with the status StatusReason. 791 // +optional 792 Group string `json:"group,omitempty" protobuf:"bytes,2,opt,name=group"` 793 // The kind attribute of the resource associated with the status StatusReason. 794 // On some operations may differ from the requested resource Kind. 795 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds 796 // +optional 797 Kind string `json:"kind,omitempty" protobuf:"bytes,3,opt,name=kind"` 798 // UID of the resource. 799 // (when there is a single resource which can be described). 800 // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids 801 // +optional 802 UID types.UID `json:"uid,omitempty" protobuf:"bytes,6,opt,name=uid,casttype=k8s.io/apimachinery/pkg/types.UID"` 803 // The Causes array includes more details associated with the StatusReason 804 // failure. Not all StatusReasons may provide detailed causes. 805 // +optional 806 // +listType=atomic 807 Causes []StatusCause `json:"causes,omitempty" protobuf:"bytes,4,rep,name=causes"` 808 // If specified, the time in seconds before the operation should be retried. Some errors may indicate 809 // the client must take an alternate action - for those errors this field may indicate how long to wait 810 // before taking the alternate action. 811 // +optional 812 RetryAfterSeconds int32 `json:"retryAfterSeconds,omitempty" protobuf:"varint,5,opt,name=retryAfterSeconds"` 813 } 814 815 // Values of Status.Status 816 const ( 817 StatusSuccess = "Success" 818 StatusFailure = "Failure" 819 ) 820 821 // StatusReason is an enumeration of possible failure causes. Each StatusReason 822 // must map to a single HTTP status code, but multiple reasons may map 823 // to the same HTTP status code. 824 // TODO: move to apiserver 825 type StatusReason string 826 827 const ( 828 // StatusReasonUnknown means the server has declined to indicate a specific reason. 829 // The details field may contain other information about this error. 830 // Status code 500. 831 StatusReasonUnknown StatusReason = "" 832 833 // StatusReasonUnauthorized means the server can be reached and understood the request, but requires 834 // the user to present appropriate authorization credentials (identified by the WWW-Authenticate header) 835 // in order for the action to be completed. If the user has specified credentials on the request, the 836 // server considers them insufficient. 837 // Status code 401 838 StatusReasonUnauthorized StatusReason = "Unauthorized" 839 840 // StatusReasonForbidden means the server can be reached and understood the request, but refuses 841 // to take any further action. It is the result of the server being configured to deny access for some reason 842 // to the requested resource by the client. 843 // Details (optional): 844 // "kind" string - the kind attribute of the forbidden resource 845 // on some operations may differ from the requested 846 // resource. 847 // "id" string - the identifier of the forbidden resource 848 // Status code 403 849 StatusReasonForbidden StatusReason = "Forbidden" 850 851 // StatusReasonNotFound means one or more resources required for this operation 852 // could not be found. 853 // Details (optional): 854 // "kind" string - the kind attribute of the missing resource 855 // on some operations may differ from the requested 856 // resource. 857 // "id" string - the identifier of the missing resource 858 // Status code 404 859 StatusReasonNotFound StatusReason = "NotFound" 860 861 // StatusReasonAlreadyExists means the resource you are creating already exists. 862 // Details (optional): 863 // "kind" string - the kind attribute of the conflicting resource 864 // "id" string - the identifier of the conflicting resource 865 // Status code 409 866 StatusReasonAlreadyExists StatusReason = "AlreadyExists" 867 868 // StatusReasonConflict means the requested operation cannot be completed 869 // due to a conflict in the operation. The client may need to alter the 870 // request. Each resource may define custom details that indicate the 871 // nature of the conflict. 872 // Status code 409 873 StatusReasonConflict StatusReason = "Conflict" 874 875 // StatusReasonGone means the item is no longer available at the server and no 876 // forwarding address is known. 877 // Status code 410 878 StatusReasonGone StatusReason = "Gone" 879 880 // StatusReasonInvalid means the requested create or update operation cannot be 881 // completed due to invalid data provided as part of the request. The client may 882 // need to alter the request. When set, the client may use the StatusDetails 883 // message field as a summary of the issues encountered. 884 // Details (optional): 885 // "kind" string - the kind attribute of the invalid resource 886 // "id" string - the identifier of the invalid resource 887 // "causes" - one or more StatusCause entries indicating the data in the 888 // provided resource that was invalid. The code, message, and 889 // field attributes will be set. 890 // Status code 422 891 StatusReasonInvalid StatusReason = "Invalid" 892 893 // StatusReasonServerTimeout means the server can be reached and understood the request, 894 // but cannot complete the action in a reasonable time. The client should retry the request. 895 // This is may be due to temporary server load or a transient communication issue with 896 // another server. Status code 500 is used because the HTTP spec provides no suitable 897 // server-requested client retry and the 5xx class represents actionable errors. 898 // Details (optional): 899 // "kind" string - the kind attribute of the resource being acted on. 900 // "id" string - the operation that is being attempted. 901 // "retryAfterSeconds" int32 - the number of seconds before the operation should be retried 902 // Status code 500 903 StatusReasonServerTimeout StatusReason = "ServerTimeout" 904 905 // StatusReasonTimeout means that the request could not be completed within the given time. 906 // Clients can get this response only when they specified a timeout param in the request, 907 // or if the server cannot complete the operation within a reasonable amount of time. 908 // The request might succeed with an increased value of timeout param. The client *should* 909 // wait at least the number of seconds specified by the retryAfterSeconds field. 910 // Details (optional): 911 // "retryAfterSeconds" int32 - the number of seconds before the operation should be retried 912 // Status code 504 913 StatusReasonTimeout StatusReason = "Timeout" 914 915 // StatusReasonTooManyRequests means the server experienced too many requests within a 916 // given window and that the client must wait to perform the action again. A client may 917 // always retry the request that led to this error, although the client should wait at least 918 // the number of seconds specified by the retryAfterSeconds field. 919 // Details (optional): 920 // "retryAfterSeconds" int32 - the number of seconds before the operation should be retried 921 // Status code 429 922 StatusReasonTooManyRequests StatusReason = "TooManyRequests" 923 924 // StatusReasonBadRequest means that the request itself was invalid, because the request 925 // doesn't make any sense, for example deleting a read-only object. This is different than 926 // StatusReasonInvalid above which indicates that the API call could possibly succeed, but the 927 // data was invalid. API calls that return BadRequest can never succeed. 928 // Status code 400 929 StatusReasonBadRequest StatusReason = "BadRequest" 930 931 // StatusReasonMethodNotAllowed means that the action the client attempted to perform on the 932 // resource was not supported by the code - for instance, attempting to delete a resource that 933 // can only be created. API calls that return MethodNotAllowed can never succeed. 934 // Status code 405 935 StatusReasonMethodNotAllowed StatusReason = "MethodNotAllowed" 936 937 // StatusReasonNotAcceptable means that the accept types indicated by the client were not acceptable 938 // to the server - for instance, attempting to receive protobuf for a resource that supports only json and yaml. 939 // API calls that return NotAcceptable can never succeed. 940 // Status code 406 941 StatusReasonNotAcceptable StatusReason = "NotAcceptable" 942 943 // StatusReasonRequestEntityTooLarge means that the request entity is too large. 944 // Status code 413 945 StatusReasonRequestEntityTooLarge StatusReason = "RequestEntityTooLarge" 946 947 // StatusReasonUnsupportedMediaType means that the content type sent by the client is not acceptable 948 // to the server - for instance, attempting to send protobuf for a resource that supports only json and yaml. 949 // API calls that return UnsupportedMediaType can never succeed. 950 // Status code 415 951 StatusReasonUnsupportedMediaType StatusReason = "UnsupportedMediaType" 952 953 // StatusReasonInternalError indicates that an internal error occurred, it is unexpected 954 // and the outcome of the call is unknown. 955 // Details (optional): 956 // "causes" - The original error 957 // Status code 500 958 StatusReasonInternalError StatusReason = "InternalError" 959 960 // StatusReasonExpired indicates that the request is invalid because the content you are requesting 961 // has expired and is no longer available. It is typically associated with watches that can't be 962 // serviced. 963 // Status code 410 (gone) 964 StatusReasonExpired StatusReason = "Expired" 965 966 // StatusReasonServiceUnavailable means that the request itself was valid, 967 // but the requested service is unavailable at this time. 968 // Retrying the request after some time might succeed. 969 // Status code 503 970 StatusReasonServiceUnavailable StatusReason = "ServiceUnavailable" 971 ) 972 973 // StatusCause provides more information about an api.Status failure, including 974 // cases when multiple errors are encountered. 975 type StatusCause struct { 976 // A machine-readable description of the cause of the error. If this value is 977 // empty there is no information available. 978 // +optional 979 Type CauseType `json:"reason,omitempty" protobuf:"bytes,1,opt,name=reason,casttype=CauseType"` 980 // A human-readable description of the cause of the error. This field may be 981 // presented as-is to a reader. 982 // +optional 983 Message string `json:"message,omitempty" protobuf:"bytes,2,opt,name=message"` 984 // The field of the resource that has caused this error, as named by its JSON 985 // serialization. May include dot and postfix notation for nested attributes. 986 // Arrays are zero-indexed. Fields may appear more than once in an array of 987 // causes due to fields having multiple errors. 988 // Optional. 989 // 990 // Examples: 991 // "name" - the field "name" on the current resource 992 // "items[0].name" - the field "name" on the first array entry in "items" 993 // +optional 994 Field string `json:"field,omitempty" protobuf:"bytes,3,opt,name=field"` 995 } 996 997 // CauseType is a machine readable value providing more detail about what 998 // occurred in a status response. An operation may have multiple causes for a 999 // status (whether Failure or Success). 1000 type CauseType string 1001 1002 const ( 1003 // CauseTypeFieldValueNotFound is used to report failure to find a requested value 1004 // (e.g. looking up an ID). 1005 CauseTypeFieldValueNotFound CauseType = "FieldValueNotFound" 1006 // CauseTypeFieldValueRequired is used to report required values that are not 1007 // provided (e.g. empty strings, null values, or empty arrays). 1008 CauseTypeFieldValueRequired CauseType = "FieldValueRequired" 1009 // CauseTypeFieldValueDuplicate is used to report collisions of values that must be 1010 // unique (e.g. unique IDs). 1011 CauseTypeFieldValueDuplicate CauseType = "FieldValueDuplicate" 1012 // CauseTypeFieldValueInvalid is used to report malformed values (e.g. failed regex 1013 // match). 1014 CauseTypeFieldValueInvalid CauseType = "FieldValueInvalid" 1015 // CauseTypeFieldValueNotSupported is used to report valid (as per formatting rules) 1016 // values that can not be handled (e.g. an enumerated string). 1017 CauseTypeFieldValueNotSupported CauseType = "FieldValueNotSupported" 1018 // CauseTypeForbidden is used to report valid (as per formatting rules) 1019 // values which would be accepted under some conditions, but which are not 1020 // permitted by the current conditions (such as security policy). See 1021 // Forbidden(). 1022 CauseTypeForbidden CauseType = "FieldValueForbidden" 1023 // CauseTypeTooLong is used to report that the given value is too long. 1024 // This is similar to ErrorTypeInvalid, but the error will not include the 1025 // too-long value. See TooLong(). 1026 CauseTypeTooLong CauseType = "FieldValueTooLong" 1027 // CauseTypeTooMany is used to report "too many". This is used to 1028 // report that a given list has too many items. This is similar to FieldValueTooLong, 1029 // but the error indicates quantity instead of length. 1030 CauseTypeTooMany CauseType = "FieldValueTooMany" 1031 // CauseTypeInternal is used to report other errors that are not related 1032 // to user input. See InternalError(). 1033 CauseTypeInternal CauseType = "InternalError" 1034 // CauseTypeTypeInvalid is for the value did not match the schema type for that field 1035 CauseTypeTypeInvalid CauseType = "FieldValueTypeInvalid" 1036 // CauseTypeUnexpectedServerResponse is used to report when the server responded to the client 1037 // without the expected return type. The presence of this cause indicates the error may be 1038 // due to an intervening proxy or the server software malfunctioning. 1039 CauseTypeUnexpectedServerResponse CauseType = "UnexpectedServerResponse" 1040 // FieldManagerConflict is used to report when another client claims to manage this field, 1041 // It should only be returned for a request using server-side apply. 1042 CauseTypeFieldManagerConflict CauseType = "FieldManagerConflict" 1043 // CauseTypeResourceVersionTooLarge is used to report that the requested resource version 1044 // is newer than the data observed by the API server, so the request cannot be served. 1045 CauseTypeResourceVersionTooLarge CauseType = "ResourceVersionTooLarge" 1046 ) 1047 1048 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 1049 1050 // List holds a list of objects, which may not be known by the server. 1051 type List struct { 1052 TypeMeta `json:",inline"` 1053 // Standard list metadata. 1054 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds 1055 // +optional 1056 ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 1057 1058 // List of objects 1059 Items []runtime.RawExtension `json:"items" protobuf:"bytes,2,rep,name=items"` 1060 } 1061 1062 // APIVersions lists the versions that are available, to allow clients to 1063 // discover the API at /api, which is the root path of the legacy v1 API. 1064 // 1065 // +protobuf.options.(gogoproto.goproto_stringer)=false 1066 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 1067 type APIVersions struct { 1068 TypeMeta `json:",inline"` 1069 // versions are the api versions that are available. 1070 // +listType=atomic 1071 Versions []string `json:"versions" protobuf:"bytes,1,rep,name=versions"` 1072 // a map of client CIDR to server address that is serving this group. 1073 // This is to help clients reach servers in the most network-efficient way possible. 1074 // Clients can use the appropriate server address as per the CIDR that they match. 1075 // In case of multiple matches, clients should use the longest matching CIDR. 1076 // The server returns only those CIDRs that it thinks that the client can match. 1077 // For example: the master will return an internal IP CIDR only, if the client reaches the server using an internal IP. 1078 // Server looks at X-Forwarded-For header or X-Real-Ip header or request.RemoteAddr (in that order) to get the client IP. 1079 // +listType=atomic 1080 ServerAddressByClientCIDRs []ServerAddressByClientCIDR `json:"serverAddressByClientCIDRs" protobuf:"bytes,2,rep,name=serverAddressByClientCIDRs"` 1081 } 1082 1083 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 1084 1085 // APIGroupList is a list of APIGroup, to allow clients to discover the API at 1086 // /apis. 1087 type APIGroupList struct { 1088 TypeMeta `json:",inline"` 1089 // groups is a list of APIGroup. 1090 // +listType=atomic 1091 Groups []APIGroup `json:"groups" protobuf:"bytes,1,rep,name=groups"` 1092 } 1093 1094 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 1095 1096 // APIGroup contains the name, the supported versions, and the preferred version 1097 // of a group. 1098 type APIGroup struct { 1099 TypeMeta `json:",inline"` 1100 // name is the name of the group. 1101 Name string `json:"name" protobuf:"bytes,1,opt,name=name"` 1102 // versions are the versions supported in this group. 1103 // +listType=atomic 1104 Versions []GroupVersionForDiscovery `json:"versions" protobuf:"bytes,2,rep,name=versions"` 1105 // preferredVersion is the version preferred by the API server, which 1106 // probably is the storage version. 1107 // +optional 1108 PreferredVersion GroupVersionForDiscovery `json:"preferredVersion,omitempty" protobuf:"bytes,3,opt,name=preferredVersion"` 1109 // a map of client CIDR to server address that is serving this group. 1110 // This is to help clients reach servers in the most network-efficient way possible. 1111 // Clients can use the appropriate server address as per the CIDR that they match. 1112 // In case of multiple matches, clients should use the longest matching CIDR. 1113 // The server returns only those CIDRs that it thinks that the client can match. 1114 // For example: the master will return an internal IP CIDR only, if the client reaches the server using an internal IP. 1115 // Server looks at X-Forwarded-For header or X-Real-Ip header or request.RemoteAddr (in that order) to get the client IP. 1116 // +optional 1117 // +listType=atomic 1118 ServerAddressByClientCIDRs []ServerAddressByClientCIDR `json:"serverAddressByClientCIDRs,omitempty" protobuf:"bytes,4,rep,name=serverAddressByClientCIDRs"` 1119 } 1120 1121 // ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match. 1122 type ServerAddressByClientCIDR struct { 1123 // The CIDR with which clients can match their IP to figure out the server address that they should use. 1124 ClientCIDR string `json:"clientCIDR" protobuf:"bytes,1,opt,name=clientCIDR"` 1125 // Address of this server, suitable for a client that matches the above CIDR. 1126 // This can be a hostname, hostname:port, IP or IP:port. 1127 ServerAddress string `json:"serverAddress" protobuf:"bytes,2,opt,name=serverAddress"` 1128 } 1129 1130 // GroupVersion contains the "group/version" and "version" string of a version. 1131 // It is made a struct to keep extensibility. 1132 type GroupVersionForDiscovery struct { 1133 // groupVersion specifies the API group and version in the form "group/version" 1134 GroupVersion string `json:"groupVersion" protobuf:"bytes,1,opt,name=groupVersion"` 1135 // version specifies the version in the form of "version". This is to save 1136 // the clients the trouble of splitting the GroupVersion. 1137 Version string `json:"version" protobuf:"bytes,2,opt,name=version"` 1138 } 1139 1140 // APIResource specifies the name of a resource and whether it is namespaced. 1141 type APIResource struct { 1142 // name is the plural name of the resource. 1143 Name string `json:"name" protobuf:"bytes,1,opt,name=name"` 1144 // singularName is the singular name of the resource. This allows clients to handle plural and singular opaquely. 1145 // The singularName is more correct for reporting status on a single item and both singular and plural are allowed 1146 // from the kubectl CLI interface. 1147 SingularName string `json:"singularName" protobuf:"bytes,6,opt,name=singularName"` 1148 // namespaced indicates if a resource is namespaced or not. 1149 Namespaced bool `json:"namespaced" protobuf:"varint,2,opt,name=namespaced"` 1150 // group is the preferred group of the resource. Empty implies the group of the containing resource list. 1151 // For subresources, this may have a different value, for example: Scale". 1152 Group string `json:"group,omitempty" protobuf:"bytes,8,opt,name=group"` 1153 // version is the preferred version of the resource. Empty implies the version of the containing resource list 1154 // For subresources, this may have a different value, for example: v1 (while inside a v1beta1 version of the core resource's group)". 1155 Version string `json:"version,omitempty" protobuf:"bytes,9,opt,name=version"` 1156 // kind is the kind for the resource (e.g. 'Foo' is the kind for a resource 'foo') 1157 Kind string `json:"kind" protobuf:"bytes,3,opt,name=kind"` 1158 // verbs is a list of supported kube verbs (this includes get, list, watch, create, 1159 // update, patch, delete, deletecollection, and proxy) 1160 Verbs Verbs `json:"verbs" protobuf:"bytes,4,opt,name=verbs"` 1161 // shortNames is a list of suggested short names of the resource. 1162 // +listType=atomic 1163 ShortNames []string `json:"shortNames,omitempty" protobuf:"bytes,5,rep,name=shortNames"` 1164 // categories is a list of the grouped resources this resource belongs to (e.g. 'all') 1165 // +listType=atomic 1166 Categories []string `json:"categories,omitempty" protobuf:"bytes,7,rep,name=categories"` 1167 // The hash value of the storage version, the version this resource is 1168 // converted to when written to the data store. Value must be treated 1169 // as opaque by clients. Only equality comparison on the value is valid. 1170 // This is an alpha feature and may change or be removed in the future. 1171 // The field is populated by the apiserver only if the 1172 // StorageVersionHash feature gate is enabled. 1173 // This field will remain optional even if it graduates. 1174 // +optional 1175 StorageVersionHash string `json:"storageVersionHash,omitempty" protobuf:"bytes,10,opt,name=storageVersionHash"` 1176 } 1177 1178 // Verbs masks the value so protobuf can generate 1179 // 1180 // +protobuf.nullable=true 1181 // +protobuf.options.(gogoproto.goproto_stringer)=false 1182 type Verbs []string 1183 1184 func (vs Verbs) String() string { 1185 return fmt.Sprintf("%v", []string(vs)) 1186 } 1187 1188 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 1189 1190 // APIResourceList is a list of APIResource, it is used to expose the name of the 1191 // resources supported in a specific group and version, and if the resource 1192 // is namespaced. 1193 type APIResourceList struct { 1194 TypeMeta `json:",inline"` 1195 // groupVersion is the group and version this APIResourceList is for. 1196 GroupVersion string `json:"groupVersion" protobuf:"bytes,1,opt,name=groupVersion"` 1197 // resources contains the name of the resources and if they are namespaced. 1198 // +listType=atomic 1199 APIResources []APIResource `json:"resources" protobuf:"bytes,2,rep,name=resources"` 1200 } 1201 1202 // RootPaths lists the paths available at root. 1203 // For example: "/healthz", "/apis". 1204 type RootPaths struct { 1205 // paths are the paths available at root. 1206 // +listType=atomic 1207 Paths []string `json:"paths" protobuf:"bytes,1,rep,name=paths"` 1208 } 1209 1210 // TODO: remove me when watch is refactored 1211 func LabelSelectorQueryParam(version string) string { 1212 return "labelSelector" 1213 } 1214 1215 // TODO: remove me when watch is refactored 1216 func FieldSelectorQueryParam(version string) string { 1217 return "fieldSelector" 1218 } 1219 1220 // String returns available api versions as a human-friendly version string. 1221 func (apiVersions APIVersions) String() string { 1222 return strings.Join(apiVersions.Versions, ",") 1223 } 1224 1225 func (apiVersions APIVersions) GoString() string { 1226 return apiVersions.String() 1227 } 1228 1229 // Patch is provided to give a concrete name and type to the Kubernetes PATCH request body. 1230 type Patch struct{} 1231 1232 // Note: 1233 // There are two different styles of label selectors used in versioned types: 1234 // an older style which is represented as just a string in versioned types, and a 1235 // newer style that is structured. LabelSelector is an internal representation for the 1236 // latter style. 1237 1238 // A label selector is a label query over a set of resources. The result of matchLabels and 1239 // matchExpressions are ANDed. An empty label selector matches all objects. A null 1240 // label selector matches no objects. 1241 // +structType=atomic 1242 type LabelSelector struct { 1243 // matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels 1244 // map is equivalent to an element of matchExpressions, whose key field is "key", the 1245 // operator is "In", and the values array contains only "value". The requirements are ANDed. 1246 // +optional 1247 MatchLabels map[string]string `json:"matchLabels,omitempty" protobuf:"bytes,1,rep,name=matchLabels"` 1248 // matchExpressions is a list of label selector requirements. The requirements are ANDed. 1249 // +optional 1250 // +listType=atomic 1251 MatchExpressions []LabelSelectorRequirement `json:"matchExpressions,omitempty" protobuf:"bytes,2,rep,name=matchExpressions"` 1252 } 1253 1254 // A label selector requirement is a selector that contains values, a key, and an operator that 1255 // relates the key and values. 1256 type LabelSelectorRequirement struct { 1257 // key is the label key that the selector applies to. 1258 Key string `json:"key" protobuf:"bytes,1,opt,name=key"` 1259 // operator represents a key's relationship to a set of values. 1260 // Valid operators are In, NotIn, Exists and DoesNotExist. 1261 Operator LabelSelectorOperator `json:"operator" protobuf:"bytes,2,opt,name=operator,casttype=LabelSelectorOperator"` 1262 // values is an array of string values. If the operator is In or NotIn, 1263 // the values array must be non-empty. If the operator is Exists or DoesNotExist, 1264 // the values array must be empty. This array is replaced during a strategic 1265 // merge patch. 1266 // +optional 1267 // +listType=atomic 1268 Values []string `json:"values,omitempty" protobuf:"bytes,3,rep,name=values"` 1269 } 1270 1271 // A label selector operator is the set of operators that can be used in a selector requirement. 1272 type LabelSelectorOperator string 1273 1274 const ( 1275 LabelSelectorOpIn LabelSelectorOperator = "In" 1276 LabelSelectorOpNotIn LabelSelectorOperator = "NotIn" 1277 LabelSelectorOpExists LabelSelectorOperator = "Exists" 1278 LabelSelectorOpDoesNotExist LabelSelectorOperator = "DoesNotExist" 1279 ) 1280 1281 // ManagedFieldsEntry is a workflow-id, a FieldSet and the group version of the resource 1282 // that the fieldset applies to. 1283 type ManagedFieldsEntry struct { 1284 // Manager is an identifier of the workflow managing these fields. 1285 Manager string `json:"manager,omitempty" protobuf:"bytes,1,opt,name=manager"` 1286 // Operation is the type of operation which lead to this ManagedFieldsEntry being created. 1287 // The only valid values for this field are 'Apply' and 'Update'. 1288 Operation ManagedFieldsOperationType `json:"operation,omitempty" protobuf:"bytes,2,opt,name=operation,casttype=ManagedFieldsOperationType"` 1289 // APIVersion defines the version of this resource that this field set 1290 // applies to. The format is "group/version" just like the top-level 1291 // APIVersion field. It is necessary to track the version of a field 1292 // set because it cannot be automatically converted. 1293 APIVersion string `json:"apiVersion,omitempty" protobuf:"bytes,3,opt,name=apiVersion"` 1294 // Time is the timestamp of when the ManagedFields entry was added. The 1295 // timestamp will also be updated if a field is added, the manager 1296 // changes any of the owned fields value or removes a field. The 1297 // timestamp does not update when a field is removed from the entry 1298 // because another manager took it over. 1299 // +optional 1300 Time *Time `json:"time,omitempty" protobuf:"bytes,4,opt,name=time"` 1301 1302 // Fields is tombstoned to show why 5 is a reserved protobuf tag. 1303 //Fields *Fields `json:"fields,omitempty" protobuf:"bytes,5,opt,name=fields,casttype=Fields"` 1304 1305 // FieldsType is the discriminator for the different fields format and version. 1306 // There is currently only one possible value: "FieldsV1" 1307 FieldsType string `json:"fieldsType,omitempty" protobuf:"bytes,6,opt,name=fieldsType"` 1308 // FieldsV1 holds the first JSON version format as described in the "FieldsV1" type. 1309 // +optional 1310 FieldsV1 *FieldsV1 `json:"fieldsV1,omitempty" protobuf:"bytes,7,opt,name=fieldsV1"` 1311 1312 // Subresource is the name of the subresource used to update that object, or 1313 // empty string if the object was updated through the main resource. The 1314 // value of this field is used to distinguish between managers, even if they 1315 // share the same name. For example, a status update will be distinct from a 1316 // regular update using the same manager name. 1317 // Note that the APIVersion field is not related to the Subresource field and 1318 // it always corresponds to the version of the main resource. 1319 Subresource string `json:"subresource,omitempty" protobuf:"bytes,8,opt,name=subresource"` 1320 } 1321 1322 // ManagedFieldsOperationType is the type of operation which lead to a ManagedFieldsEntry being created. 1323 type ManagedFieldsOperationType string 1324 1325 const ( 1326 ManagedFieldsOperationApply ManagedFieldsOperationType = "Apply" 1327 ManagedFieldsOperationUpdate ManagedFieldsOperationType = "Update" 1328 ) 1329 1330 // FieldsV1 stores a set of fields in a data structure like a Trie, in JSON format. 1331 // 1332 // Each key is either a '.' representing the field itself, and will always map to an empty set, 1333 // or a string representing a sub-field or item. The string will follow one of these four formats: 1334 // 'f:<name>', where <name> is the name of a field in a struct, or key in a map 1335 // 'v:<value>', where <value> is the exact json formatted value of a list item 1336 // 'i:<index>', where <index> is position of a item in a list 1337 // 'k:<keys>', where <keys> is a map of a list item's key fields to their unique values 1338 // If a key maps to an empty Fields value, the field that key represents is part of the set. 1339 // 1340 // The exact format is defined in sigs.k8s.io/structured-merge-diff 1341 // +protobuf.options.(gogoproto.goproto_stringer)=false 1342 type FieldsV1 struct { 1343 // Raw is the underlying serialization of this object. 1344 Raw []byte `json:"-" protobuf:"bytes,1,opt,name=Raw"` 1345 } 1346 1347 func (f FieldsV1) String() string { 1348 return string(f.Raw) 1349 } 1350 1351 // TODO: Table does not generate to protobuf because of the interface{} - fix protobuf 1352 // generation to support a meta type that can accept any valid JSON. This can be introduced 1353 // in a v1 because clients a) receive an error if they try to access proto today, and b) 1354 // once introduced they would be able to gracefully switch over to using it. 1355 1356 // Table is a tabular representation of a set of API resources. The server transforms the 1357 // object into a set of preferred columns for quickly reviewing the objects. 1358 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 1359 // +protobuf=false 1360 type Table struct { 1361 TypeMeta `json:",inline"` 1362 // Standard list metadata. 1363 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds 1364 // +optional 1365 ListMeta `json:"metadata,omitempty"` 1366 1367 // columnDefinitions describes each column in the returned items array. The number of cells per row 1368 // will always match the number of column definitions. 1369 // +listType=atomic 1370 ColumnDefinitions []TableColumnDefinition `json:"columnDefinitions"` 1371 // rows is the list of items in the table. 1372 // +listType=atomic 1373 Rows []TableRow `json:"rows"` 1374 } 1375 1376 // TableColumnDefinition contains information about a column returned in the Table. 1377 // +protobuf=false 1378 type TableColumnDefinition struct { 1379 // name is a human readable name for the column. 1380 Name string `json:"name"` 1381 // type is an OpenAPI type definition for this column, such as number, integer, string, or 1382 // array. 1383 // See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for more. 1384 Type string `json:"type"` 1385 // format is an optional OpenAPI type modifier for this column. A format modifies the type and 1386 // imposes additional rules, like date or time formatting for a string. The 'name' format is applied 1387 // to the primary identifier column which has type 'string' to assist in clients identifying column 1388 // is the resource name. 1389 // See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for more. 1390 Format string `json:"format"` 1391 // description is a human readable description of this column. 1392 Description string `json:"description"` 1393 // priority is an integer defining the relative importance of this column compared to others. Lower 1394 // numbers are considered higher priority. Columns that may be omitted in limited space scenarios 1395 // should be given a higher priority. 1396 Priority int32 `json:"priority"` 1397 } 1398 1399 // TableRow is an individual row in a table. 1400 // +protobuf=false 1401 type TableRow struct { 1402 // cells will be as wide as the column definitions array and may contain strings, numbers (float64 or 1403 // int64), booleans, simple maps, lists, or null. See the type field of the column definition for a 1404 // more detailed description. 1405 // +listType=atomic 1406 Cells []interface{} `json:"cells"` 1407 // conditions describe additional status of a row that are relevant for a human user. These conditions 1408 // apply to the row, not to the object, and will be specific to table output. The only defined 1409 // condition type is 'Completed', for a row that indicates a resource that has run to completion and 1410 // can be given less visual priority. 1411 // +optional 1412 // +listType=atomic 1413 Conditions []TableRowCondition `json:"conditions,omitempty"` 1414 // This field contains the requested additional information about each object based on the includeObject 1415 // policy when requesting the Table. If "None", this field is empty, if "Object" this will be the 1416 // default serialization of the object for the current API version, and if "Metadata" (the default) will 1417 // contain the object metadata. Check the returned kind and apiVersion of the object before parsing. 1418 // The media type of the object will always match the enclosing list - if this as a JSON table, these 1419 // will be JSON encoded objects. 1420 // +optional 1421 Object runtime.RawExtension `json:"object,omitempty"` 1422 } 1423 1424 // TableRowCondition allows a row to be marked with additional information. 1425 // +protobuf=false 1426 type TableRowCondition struct { 1427 // Type of row condition. The only defined value is 'Completed' indicating that the 1428 // object this row represents has reached a completed state and may be given less visual 1429 // priority than other rows. Clients are not required to honor any conditions but should 1430 // be consistent where possible about handling the conditions. 1431 Type RowConditionType `json:"type"` 1432 // Status of the condition, one of True, False, Unknown. 1433 Status ConditionStatus `json:"status"` 1434 // (brief) machine readable reason for the condition's last transition. 1435 // +optional 1436 Reason string `json:"reason,omitempty"` 1437 // Human readable message indicating details about last transition. 1438 // +optional 1439 Message string `json:"message,omitempty"` 1440 } 1441 1442 type RowConditionType string 1443 1444 // These are valid conditions of a row. This list is not exhaustive and new conditions may be 1445 // included by other resources. 1446 const ( 1447 // RowCompleted means the underlying resource has reached completion and may be given less 1448 // visual priority than other resources. 1449 RowCompleted RowConditionType = "Completed" 1450 ) 1451 1452 type ConditionStatus string 1453 1454 // These are valid condition statuses. "ConditionTrue" means a resource is in the condition. 1455 // "ConditionFalse" means a resource is not in the condition. "ConditionUnknown" means kubernetes 1456 // can't decide if a resource is in the condition or not. In the future, we could add other 1457 // intermediate conditions, e.g. ConditionDegraded. 1458 const ( 1459 ConditionTrue ConditionStatus = "True" 1460 ConditionFalse ConditionStatus = "False" 1461 ConditionUnknown ConditionStatus = "Unknown" 1462 ) 1463 1464 // IncludeObjectPolicy controls which portion of the object is returned with a Table. 1465 type IncludeObjectPolicy string 1466 1467 const ( 1468 // IncludeNone returns no object. 1469 IncludeNone IncludeObjectPolicy = "None" 1470 // IncludeMetadata serializes the object containing only its metadata field. 1471 IncludeMetadata IncludeObjectPolicy = "Metadata" 1472 // IncludeObject contains the full object. 1473 IncludeObject IncludeObjectPolicy = "Object" 1474 ) 1475 1476 // TableOptions are used when a Table is requested by the caller. 1477 // +k8s:conversion-gen:explicit-from=net/url.Values 1478 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 1479 type TableOptions struct { 1480 TypeMeta `json:",inline"` 1481 1482 // NoHeaders is only exposed for internal callers. It is not included in our OpenAPI definitions 1483 // and may be removed as a field in a future release. 1484 NoHeaders bool `json:"-"` 1485 1486 // includeObject decides whether to include each object along with its columnar information. 1487 // Specifying "None" will return no object, specifying "Object" will return the full object contents, and 1488 // specifying "Metadata" (the default) will return the object's metadata in the PartialObjectMetadata kind 1489 // in version v1beta1 of the meta.k8s.io API group. 1490 IncludeObject IncludeObjectPolicy `json:"includeObject,omitempty" protobuf:"bytes,1,opt,name=includeObject,casttype=IncludeObjectPolicy"` 1491 } 1492 1493 // PartialObjectMetadata is a generic representation of any object with ObjectMeta. It allows clients 1494 // to get access to a particular ObjectMeta schema without knowing the details of the version. 1495 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 1496 type PartialObjectMetadata struct { 1497 TypeMeta `json:",inline"` 1498 // Standard object's metadata. 1499 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 1500 // +optional 1501 ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 1502 } 1503 1504 // PartialObjectMetadataList contains a list of objects containing only their metadata 1505 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 1506 type PartialObjectMetadataList struct { 1507 TypeMeta `json:",inline"` 1508 // Standard list metadata. 1509 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds 1510 // +optional 1511 ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 1512 1513 // items contains each of the included items. 1514 Items []PartialObjectMetadata `json:"items" protobuf:"bytes,2,rep,name=items"` 1515 } 1516 1517 // Condition contains details for one aspect of the current state of this API Resource. 1518 // --- 1519 // This struct is intended for direct use as an array at the field path .status.conditions. For example, 1520 // 1521 // type FooStatus struct{ 1522 // // Represents the observations of a foo's current state. 1523 // // Known .status.conditions.type are: "Available", "Progressing", and "Degraded" 1524 // // +patchMergeKey=type 1525 // // +patchStrategy=merge 1526 // // +listType=map 1527 // // +listMapKey=type 1528 // Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` 1529 // 1530 // // other fields 1531 // } 1532 type Condition struct { 1533 // type of condition in CamelCase or in foo.example.com/CamelCase. 1534 // --- 1535 // Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be 1536 // useful (see .node.status.conditions), the ability to deconflict is important. 1537 // The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) 1538 // +required 1539 // +kubebuilder:validation:Required 1540 // +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])$` 1541 // +kubebuilder:validation:MaxLength=316 1542 Type string `json:"type" protobuf:"bytes,1,opt,name=type"` 1543 // status of the condition, one of True, False, Unknown. 1544 // +required 1545 // +kubebuilder:validation:Required 1546 // +kubebuilder:validation:Enum=True;False;Unknown 1547 Status ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status"` 1548 // observedGeneration represents the .metadata.generation that the condition was set based upon. 1549 // For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date 1550 // with respect to the current state of the instance. 1551 // +optional 1552 // +kubebuilder:validation:Minimum=0 1553 ObservedGeneration int64 `json:"observedGeneration,omitempty" protobuf:"varint,3,opt,name=observedGeneration"` 1554 // lastTransitionTime is the last time the condition transitioned from one status to another. 1555 // This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. 1556 // +required 1557 // +kubebuilder:validation:Required 1558 // +kubebuilder:validation:Type=string 1559 // +kubebuilder:validation:Format=date-time 1560 LastTransitionTime Time `json:"lastTransitionTime" protobuf:"bytes,4,opt,name=lastTransitionTime"` 1561 // reason contains a programmatic identifier indicating the reason for the condition's last transition. 1562 // Producers of specific condition types may define expected values and meanings for this field, 1563 // and whether the values are considered a guaranteed API. 1564 // The value should be a CamelCase string. 1565 // This field may not be empty. 1566 // +required 1567 // +kubebuilder:validation:Required 1568 // +kubebuilder:validation:MaxLength=1024 1569 // +kubebuilder:validation:MinLength=1 1570 // +kubebuilder:validation:Pattern=`^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$` 1571 Reason string `json:"reason" protobuf:"bytes,5,opt,name=reason"` 1572 // message is a human readable message indicating details about the transition. 1573 // This may be an empty string. 1574 // +required 1575 // +kubebuilder:validation:Required 1576 // +kubebuilder:validation:MaxLength=32768 1577 Message string `json:"message" protobuf:"bytes,6,opt,name=message"` 1578 } 1579