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